Skip to content

Instantly share code, notes, and snippets.

@andrewwippler
Created April 17, 2015 22:15
Show Gist options
  • Save andrewwippler/3eb28284614843ea1fc6 to your computer and use it in GitHub Desktop.
Save andrewwippler/3eb28284614843ea1fc6 to your computer and use it in GitHub Desktop.
Join Centos 6 to Domian
#!/bin/bash
NETBIOS="$1"
FQDN="$2"
USER="$3"
#install files
sudo yum -y install authconfig krb5-workstation pam_krb5 samba-winbind oddjob-mkhomedir nscd
#create auth settings
authconfig --enablecachecreds --enablewinbind --enablewinbindauth --smbsecurity=ads --smbworkgroup=$NETBIOS --smbrealm=$FQDN --enablewinbindusedefaultdomain --winbindtemplatehomedir=/home/$NETBIOS/%U --winbindtemplateshell=/bin/bash --enablekrb5 --krb5realm=$FQDN --enablekrb5kdcdns --enablekrb5realmdns --enablelocauthorize --enablemkhomedir --enablepamaccess --updateall
#join
net ads join $FQDN -U $USER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment