How to add SME to an Active Directory as a member server using kerberos
First of all, no credit to me, I just pieced this together from various posts/sites.
Notes:
This configuration assumes DNS runs on the Active Directory Server.
If you have DNS running as it should, their is no need to edit the hosts and resolve.conf file.
You should however doublecheck hostname lookup and reverse lookup.
I have tested this on a clean Sme 6.5rc1 and 6.0.1 install, 6.0.1 requires you update
to samba 3 (look here:
http://lists.contribs.org/mailman/public/devinfo/msg07291.html )
I posted the entire contents of the files I changed, you may find differences if you
have already made changes to these files.
I am unfamiliar with the whole naming concept of templates, you might want to
append items in other templates.
You should not change the case of the realm/hosts in krb5.conf,
kerberos is supposed to be sensitive about that.
The next step for me is to look at the mail authentication,
but I can't seem to figure out how to configure this.
Anybody know how this is done?
I've read about dovecot's authentication being done by mailfront,
but I'm not sure where to look for mailfront and its config.
(Attempts at changing dovecots config failed: no effect

)
ISSUE:
Currently home directories in samba are not automaticly created,
and to gain access I use the following:
root# mkdir -p /home/e-smith/files/users/username/home
root# chown -R 'delirium\username' /home/e-smith/files/users/username
Anybody know how/where to script this?
(Probably something not that hard to find, still need to look in to that)
The sample configuration uses:
delirium.com As the Domain Name
addc As the Active Directory Server (Domain Controller)
172.16.1.2 As the addc's ip address
-------------------------------------------------
Domain Controller should have this configured:
DNS:
"A" Record for SME server
"PTR" Record for SME server
server-manager:
(Configuration) Workgroup -->
Windows workgroup name: DELIRIUM
#If this is a clean install we will have to create the templates-custom/etc dir aswell
mkdir /etc/e-smith/templates-custom/etc
cd /etc/e-smith/templates-custom/etc/
#If their not already there, copy the templates to their custom location
mkdir hosts
cp /etc/e-smith/templates/etc/hosts/20hostname hosts/
mkdir resolv.conf
cp /etc/e-smith/templates/etc/resolv.conf/10domain resolv.conf/
cp /etc/e-smith/templates/etc/resolv.conf/25nameserver resolv.conf/
mkdir nsswitch.conf
cp /etc/e-smith/templates/etc/nsswitch.conf/10files nsswitch.conf
mkdir pam.d
mkdir pam.d/login
cp /etc/e-smith/templates/etc/pam.d/login/20auth pam.d/login/
cp /etc/e-smith/templates/etc/pam.d/login/30account pam.d/login/
mkdir smb.conf
cp /etc/e-smith/templates/etc/smb.conf/10globals smb.conf/
cp /etc/e-smith/templates/etc/smb.conf/11nameResolveOrder smb.conf/
cp /etc/e-smith/templates/etc/smb.conf/11security smb.conf/
#Backup /etc/krb5.conf
cp /etc/krb5.conf /etc/krb5.conf.orig
Edit the following files (still in the /etc/e-smith/templates-custom/etc/ dir)
Example: pico hosts/20hostname
-----------------hosts/20hostname----------------
{
$OUT .= "$LocalIP\t";
$OUT .= " ${SystemName}.${DomainName}";
$OUT .= " ${SystemName}\n";
$OUT .= "172.16.1.2\t";
$OUT .= " addc.${DomainName}";
$OUT .= " addc";
}
---------------resolv.conf/10domain--------------
{
$OUT .= "domain $DomainName\n";
$OUT .= "search $DomainName";
}
-------------resolv.conf/25nameserver------------
nameserver 172.16.1.2
--------------nsswitch.conf/10files--------------
passwd: files winbind
shadow: files
group: files winbind
hosts: { ($AccessType eq "off") ? "files" : "files dns" }
services: files
networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
automount: files
aliases: files
----------------pam.d/login/20auth----------------
{
use esmith::db;
use esmith::config;
local $conf{'telnet'} = $telnet;
my $rootLogin = db_get_prop(\%conf, "telnet", "PermitRootLogin")
|| "no";
if (defined $rootLogin && $rootLogin eq 'no')
{
$OUT .= "auth required /lib/security/pam_securetty.so\n";
}
$OUT .= "auth sufficient /lib/security/pam_winbind.so\n";
$OUT .= "auth sufficient /lib/security/pam_unix.so use_first_pass\n";
$OUT .= "auth required /lib/security/pam_stack.so service=system-auth\n";
$OUT .= "auth required /lib/security/pam_nologin.so\n";
}
--------------pam.d/login/30account---------------
account sufficient /lib/security/pam_winbind.so
account required /lib/security/pam_stack.so service=system-auth
----------------smb.conf/10globals----------------
[global]
encrypt passwords = yes
idmap uid = 10000-20000
idmap gid = 10000-20000
password server = addc.delirium.com
realm = delirium.com
template homedir = /home/e-smith/files/users/%U/home
template shell = /bin/bash
winbind enum users = yes
winbind enum groups = yes
-----------smb.conf/11nameResolveOrder------------
name resolve order = host wins lmhosts bcast
---------------smb.conf/11security----------------
security = ads
-------------------/etc/krb5.conf-----------------
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
ticket_lifetime = 24000
default_realm = DELIRIUM.COM
dns_lookup_realm = false
dns_lookup_kdc = false
[realms]
DELIRIUM.COM = {
kdc = addc.delirium.com:88
admin_server = addc.delirium.com:749
default_domain = delirium.com
}
[domain_realm]
.delirium.com = DELIRIUM.COM
delirium.com = DELIRIUM.COM
[kdc]
profile = /var/kerberos/krb5kdc/kdc.conf
[appdefaults]
pam = {
debug = false
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
}
Execute the following commands as root:
root# /sbin/e-smith/expand-template /etc/hosts
root# /sbin/e-smith/expand-template /etc/resolv.conf
root# /sbin/e-smith/expand-template /etc/smb.conf
root# /sbin/e-smith/expand-template /etc/nssswitch.conf
root# /sbin/e-smith/expand-template /etc/pam.d/login
root# service winbind start
root# net ads join -U Administrator
#The above user must be authorised to add the server to the Active Directory
#Not sure how I should set winbind to enabled, so this starts winbind (in runlevel 7?) on boot
root# ln /etc/rc.d/init.d/winbind /etc/rc.d/rc7.d/S92Winbind
#Use these for testing
#The last entries should be your ADS users:
root# /usr/bin/getent passwd
#The last entries should be your ADS groups:
root# /usr/bin/getent group
If I made any mistakes, be gentle, I'm pretty new at this
