Differences between revisions 14 and 16 (spanning 2 versions)
Revision 14 as of 2007-05-17 03:08:09
Size: 7717
Editor: JohnJacob
Revision 16 as of 2007-05-17 03:45:16
Size: 653
Editor: JohnJacob
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
Linux Samba Configuration: '''Linux Samba Configuration''':
Line 8: Line 8:
Thisisthwsambalink [[BR]]

Debian Samba server connecting to Active directory

1. Installing software

The first thing that you need to do is to install the required packages.

 #aptitude update
 #aptitude upgrade
 #aptitude install samba smbclient winbind krb5-doc krb5-user krb5-config

Windows server information

In this configuration I used the following windows info.

Domain name: is414
Fully qualified domain name: is414.com
Window domain controller: rkb-server

Kerberos setup

Open /etc/krb5.conf

add the following lines to the krb.conf file.

  default_realm = IS414

  IS414.COM = {
   kdc – rkb-server.is414.com
   admin_server – rkb-server.is414.com

  .kerberos.server = IS414.COM

After that has been completed do the following:

 #kinit administrator@IS414.COM

Verify that it worked by using the following command:

Samba Setup

Open the samba configuration file /etc/samba/smb.conf and add the following:

  security = ADS
  password server = rkb-server
  encrypt passwords = yes
  workgroup = IS414
  realm = IS414.COM
  idmap uid = 10000-20000
  idmap gid = 10000-20000
  winbind enum users = yes
  winbind enum groups = yes
  winbind use default domain = yes
  winbind separator = +

Creating a share in /etc/samba/smb.conf. Replace WindowsShare with any name you want.
first create the folder:
 #mkdir /home/WindowsShare
 #chmod 777 /home/WindowsShare

Add the following in the /etc/samba/smb.conf

  comment = Windows Share
  path = /home/WindowsShare
  read only = no
  create mask = 0775
  directory mask = 0775
  browsable = yes
  public = yes
  writeable = yes
  force create mode = 0775
  force directory mode = 0775
  force security mode = 0775
  guest ok = no
  inherit permissions = yes
  nt acl support = yes

Test your configuration with the following command:

 #testparm -v

Now you must restart the samba deamon.

 # /etc/init.d/samba stop

Winbind configuration

Stop the winbind deamon.

 #/etc/init.d/winbind stop

edit the couple of lines of the /etc/nsswitch.conf file.

 passwd: compat winbind
 group: compat winbind

Joining the Domain

start the samba and winbind deamons

 #/etc/init.d/samba start
 #/etc/init.d/winbind start

Join the domain with the following command

 #net ads join -U administrator

Test winbind with the following commands

 #wbinfo -u

The wbinfo – u should list the AD users

 #wbinfo – g

The wbinfo – g should list the AD groups

All that is left is to test the connection from the server to verify that the share is working.
Line 138: Line 12:
Linux Client Configuration: '''''Linux Client Configuration''''':
Line 140: Line 14:
Joining a Debian Client to Active Directory

Note: This walkthrough was taken almost entirely from https://help.ubuntu.com/community/ActiveDirectoryWinbindHowto. A few configuration changes in the PAM section and verbiage used are the only differences.

Required Software/Packages

MS Server 2003 w/AD and DNS
2003 Standard
(Ubuntu 6.10)

Time settings

Kerberos requires that the device time be within a few minutes of the server time. Utilize NTP-Server to confirm time synchronization.

Location: /etc/default/ntpdate

#servers to check
NTPSERVERS= “example.test.server.com”
#additional options for ntpdate

root@linux:~# /etc/init.d/ntpdate restart
*Synchronizing clock to example.test.server.com… [ok]


A valid FQDN is necessary for Kerberos and AD. Edit the local host file so that it is resolvable.

Location: /etc/hosts linux.test.server.com localhost linux

Configure Kerberos

Use apt-get install to install the following packages:
 krb5-user (Universe repository)

krb5 template
Location: /etc/krb5.conf

 Default = FILE:/var/log/krb5.log

 ticket_lifetime = 24000
 clock-skew = 300
 default_realm = test.server.com
# dns_lookup_realm = false
# dns_lookup_kdc = true

 test.example.com = {
  kdc = example.test.server.com:88
  admin_server = example.test.server.com:464
  default_domain = test.server.com


 .server.com = test.server.com
 server.com = test.server.com

Test your configuration by requesting a ticket
root@linux:~# kinit Administrator@test.server.com
Password for Administrator@test.server.com : ****

Use klist to verify request worked
root@linux:~# klist
Ticket cache: File: /tmp/krb5cc_0
Default principal: Administrator@test.server.com

Valid starting Expires Service principal
05/16/07 10:30:42 05/16/07 20:30:01
 renew until 05/16/07 10:30:42

Join the Domain

Use apt-get install to install the following packages:

Location: /etc/samba/smb.conf

 security = ads
 realm = test.server.com
 password server =
 workgroup = test
# winbind separator = +
 idmap uid = 10000-20000
 idmap gid = 10000-20000
 winbind enum users = yes
 winbind enum groups = yes
 template homedir = /home/%D/%U
 template shell = /bin/bash
 client use sponego = yes
 client ntlmv2 auth = yes
 encrypt passwords = yes
 winbind use default domain = yes
 restrict anonymous = 2
 domain master = no
 local master = no
 preferred master = no
 os level = 0

Restart services
root@linux:~# /etc/init.d/winbind stop
root@linux:~# /etc/init.d/samba restart
root@linux:~# /etc/init.d/winbind start

Request Kerberos TGT for an account
root@linux:~# n et ads join

Using short domain name – test

Joined ‘Linux’ to realm ‘test.server.com’

# wbinfo – u

Setup Authentication

Location: /etc/nsswitch.conf

passwd: compat winbind
group: compat winbind
shadow: compat

root@linux:~# getent passwd

. . .
. . .

root@linux:~#: getent group

. . .
test+domain-admins:x:10006: user, administrator
. . .


Location: /etc/pam.d/common-account

account sufficient pam_winbind.so
account required pam_unix.so

Location: /etc/pam.d/common-auth

auth sufficient pam_winbind.so
auth sufficient pam_unix.so nullok_secure use_first_pass
auth required pam_deny.so

Location: /etc/pam.d/common-session

session required pam_unix.so
session required pam_mkhomedir.so umask=0022 skel=/etc/skel

Location: /etc/pam.d/sudo

Auth sufficient pam_winbind.so
Auth sufficient pam_unix.so use_first_pass
Auth required pam_deny.so

@include common-account

Final Config

Each domain needs a directory in home
root@linux:~# mkdir /home/test

login: test+user
password: ****
. . .

Authenticating Debian & Samba to Active Directory (!)

  • This walkthrough is designed to give instructions for configuring Linux servers/clients to authenticate to Active Directory. The purpose is to join a Linux samba server and a Linux client to an existing AD structure. The samba connects seamlessly for Windows and Linux users alike. The walkthrough is broken into two sections and is available in via the links below.

Linux Samba Configuration:


Linux Client Configuration: