I have attached my scripts. for me, I put these files on an internal webhost and then wget it and run it. the kerb.txt file should be renamed to kerb.sh and the 2 other files should have the .txt extension removed. I make plenty of backups in my scripts (I like backups) but test for yourself before putting this on anything live. Obviously you will need to make adjustments because I have omitted my actual DC servers and domain name, but other than that its exactly what I use on a new machine to auth it for AD auth. and fyi, if you install something that uses PAM after running this script, the PAM file will probably need to be updated (like ssh or webmin) to use AD auth. and of course give yourself sudo if you need that. in my samba config I am also creating a c$ share, because I like to be able to browse to c$
the only problem I have had with this and haven't had time to script this fix, is that samba and winbind need to be started and in a particular order for it to work properly. So if this doesn't work immediatly then you need to
Code:
/etc/init.d/winbind stop
/etc/init.d/samba restart
/etc/init.d/winbind start
and all should be good.
The way I fix that is to remove the init scripts for samba and winbind
Code:
update-rcd -f remove winbind
update-rcd -f remove samba
and I then create my own init script that starts samba first and then starts winbind. it doesn't seem to work properly if winbind is started first.
after lots of trial and error and trying other methods, this is the best I have come across. and I can't take credit for the steps because I pieced most of it together from 2 or 3 sources (can't remember now), but I automated it and scripted it myself.
I have so far never shown this to anyone outside of my co so I would really appreciate comments.
Thanks.