Alright, I'll have to go on my notes, I did this on Thanksgiving Day, so I may not remember everything I did. Anyway, here goes:
- Active Directory should already be implemented and working. If you need help, there's plenty of help on the net.
- Your Windows system should be secured and patched.
- You have Gentoo Linux installed of course
- With the config files, you need to change example.com to match your domain.
Okay, now the basics are done, let's begin the install process.
Step 1: Emerge openldap. No configuration is necessary. However, AD support will not be compiled into samba without it.
Step 2: Emerge mit-krb5. Configure the file /etc/krb5.conf as follows:
Code: Select all
[libdefaults]
default_realm = EXAMPLE.COM
[realms]
EXAMPLE.COM = {
kdc = adserver.example.com
}Code: Select all
1.2.3.4 adserver.example.com adserverNotes about this config file, do NOT change the case of EXAMPLE.COM because you will get the following error message: "Cannot find KDC for requested realm while getting initial credentials". Also, do NOT comment the config file because the kerberos client will not read the config file correctly.
Step 3: We will stop here and test kerberos to ensure you can see the AD domain type in this command:
Code: Select all
kinit Administrator@EXAMPLE.COMStep 4: We are now going to emerge samba. You can do this one of two ways:
- Add kerberos and ldap to your USE flags make.conf file. Emerge samba using the following command: OR
Code: Select all
emerge samba - Type in the following command:
Code: Select all
USE="kerberos ldap" emerge samba
Use the command
Code: Select all
emerge -pv kerberosCode: Select all
[ebuild R ] net-fs/samba-3.0.2a -acl +cups +kerberos +ldap +mysql -oav +pam +python +readline +xml 127 kbCode: Select all
# Separate domain and username with '+', like DOMAIN+username
[global]
netbios name = SERVERNAME <- I recommend the same name as the server.
socket options = TCP_NODELAY SO_RCVBUF=16384 SO_SNDBUF=16384 <- Tweak this to get the best speed out of your connection
idmap uid = 10000-20000 <- This is for mapping uids between linux server and AD
winbind enum users = yes <- This allows you to bind users.
winbind gid = 10000-20000 <- This is for mapping gids between linux server and AD
workgroup = WORKGROUP <- Change to match the NETBIOS name of the AD domain.
os level = 20 <- This is for the master browser priority.
winbind enum groups = yes <- This allows you to use the Active Directory groups
socket address = 1.2.3.4 <- Change this to match the IP address or remove it to listen to all addresses.
password server = * <- I recommend this if you have more than one server; I do in my case.
preferred master = no <- You do NOT want to be a master browser.
winbind separator = + <- See the first line comment.
max log size = 50 <- In K
log file = /var/log/samba3/log.%m <- This allows logging activities for each machine.
encrypt passwords = yes <- Active directory does NOT accept plaintext passwords.
dns proxy = no <- You don't want anything to do with DNS.
realm = EXAMPLE.COM <- This is for kerberos.
security = ADS <- Active directory server provides security for the shared resources.
wins server = 1.2.3.4 <- Change to IP address of your installed WINS server
wins proxy = no <- You don't want to proxy WINS either.
# Shares section
[mp3] <- Name of the share.
comment = MP3 Repository <- A comment...
writeable = yes <- If you want users to update the directory
path = /home/mp3 <- Where is the share on the linux server
force user = mp3 <- Should be the name of the user who is responsible for the share.
Code: Select all
/etc/init.d/samba startCode: Select all
net ads join -U AdministratorStep 7: We are going to test winbind to ensure windows authentication does indeed work. Winbind allows you to use Active Directory for user authentication (see link 2 for more info). The steps for using and testing winbind are gleaned from link 2.
You need to edit the file /etc/nsswitch.conf You need to change two lines to look like this (other lines removed to keep this post short as possible):
Code: Select all
passwd: compat winbind
shadow: compat
group: compat winbindCode: Select all
winbinddSince there is no visual confirmation whether or not it's running, you can check with ps to ensure it is indeed running.
Code: Select all
ps -ae | grep winbindd
The results should be something similar to this:
13324 ? 00:04:23 winbindd
13325 ? 00:00:00 winbinddLet's make sure we can see the contents of Active Directory. Type in this command:
Code: Select all
wbinfo -uCode: Select all
EXAMPLE+test <- test account on AD
EXAMPLE+test2 <- test account on AD
EXAMPLE+Administrator
EXAMPLE+Guest
EXAMPLE+TsInternetUser
EXAMPLE+krbtgt
EXAMPLE+MACHINE1$ <- test machine 1
EXAMPLE+MACHINE2$ <- test machine 2
EXAMPLE+MACHINE3$ <- test machine 3
EXAMPLE+HOST/servername <- samba machine
EXAMPLE+DOMAINCONTROLLER$Code: Select all
wbinfo -gCode: Select all
EXAMPLE+Domain Computers
EXAMPLE+Domain Controllers
EXAMPLE+Schema Admins
EXAMPLE+Enterprise Admins
EXAMPLE+Cert Publishers
EXAMPLE+Domain Admins
EXAMPLE+Domain Users
EXAMPLE+Domain Guests
EXAMPLE+Group Policy Creator Owners
EXAMPLE+DnsUpdateProxyCode: Select all
getent passwdFor groups, type in getent group
I will not post the results of this command for security reasons, but you should see a list of local groups with the Active Directory groups appended.
I would suggest reading the info in link 2 for more things you can do with other authentication with AD.
If everything has worked as above, pat yourself on the back! Good job!
Step 8: If you didn't configure a share yet; do so now. You need to restart samba if you created a share.
You should join any machine you want to access the samba resources to your Active Directory Domain. Use a machine that's joined to the AD domain to see if your share appears via network neighborhood.
If you want samba and winbind to run on startup, type in the following commands:
Code: Select all
rc-update add samba default
rc-update add winbind defaultResources:
The samba/ADS howto: http://us1.samba.org/samba/docs/man/dom ... ads-member
Helpful info for winbind: http://us1.samba.org/samba/docs/man/winbind.html[b][/b]


