These scripts are fine for setting up individual Ubuntu workstations, but, because they install ntp packages they should not currently (Apr 25, 2013) be used to set up LXC containers. -- AdrianPepper - 2013-04-25 |
/etc/ssh/ssh_host_dsa_key /etc/ssh/ssh_host_dsa_key.pub /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_rsa_key.pub /etc/ssl/private
cscf.cs# ssh scspc400 The authenticity of host 'scspc400 (129.97.170.65)' can't be established. RSA key fingerprint is 17:9c:eb:dc:f7:58:c7:f4:4b:9a:5e:fc:31:31:ac:6d. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'scspc400,129.97.170.65' (RSA) to the list of known hosts. root@scspc400's password: Permission denied, please try again.Since it can't SSH get the key to the machine.
cscf.cs# grep root /etc/passwd root:x:0:1:Super-User:/:/sbin/sh cscf.cs# cd /.ssh cscf.cs# scp id_dsa.pub cscf-adm@scspc400: cscf-adm@scspc400's password: id_dsa.pub 100% 602 0.6KB/s 00:00Put the root key in the root account on the machine.
cscf.cs# ssh cscf-adm@scspc400 cscf-adm@scspc400's password: ... /usr/bin/xauth: creating new authority file /home/cscf-adm/.Xauthority cscf-adm@scspc400:~$ sudo -s [sudo] password for cscf-adm: root@scspc400:~# grep root /etc/passwd root:x:0:0:root:/root:/bin/bash root@scspc400:~# cd /root root@scspc400:/root# cd .ssh bash: cd: .ssh: No such file or directory root@scspc400:/root# mkdir .ssh root@scspc400:/root# cd .ssh root@scspc400:/root/.ssh# cat /home/cscf-adm/id_dsa.pub >> authorized_keys root@scspc400:/root/.ssh# rm /home/cscf-adm/id_dsa.pubTest the root login from cscf.cs. There should be no prompt for a password.
cscf.cs# ssh scspc400 Warning: untrusted X11 forwarding setup failed: xauth key data not generated Warning: No xauth data; using fake authentication data for X11 forwarding. Linux scspc400.cs.uwaterloo.ca 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:45:36 UTC 2010 x86_64 GNU/Linux Ubuntu 10.10 Welcome to Ubuntu! ... /usr/bin/xauth: creating new authority file /root/.Xauthority root@scspc400:~#
cscf.cs# cd /u1/ctucker/bin/host_setup cscf.cs# pwd /u1/ctucker/bin/host_setup cscf.cs# ./linux_into_ad_v4.sh scspc400.cs.uwaterloo.ca CS-GENERAL -wThe script will prompt for input at various stages. The script will typically run in 5 to 10 minutes.
CS-GENERAL/ldap.conf CS-GENERAL/krb5.conf CS-GENERAL/common-auth CS-GENERAL/common-account CS-GENERAL/common-session CS-GENERAL/common-password TRUE FALSE viridis.cs.uwaterloo.ca scspc400.cs.uwaterloo.ca scspc400 CS.UWATERLOO.CA host/ubuntu_scspc400.cs.uwaterloo.ca@CS.UWATERLOO.CA viridis.cs.uwaterloo.ca OU=Linux Hosts,OU=CS,DC=cs,DC=uwaterloo,DC=ca CN=scspc400_host,OU=Linux Hosts,OU=CS,DC=cs,DC=uwaterloo,DC=ca TRUE /tmp/active-directory-computer-creation_ldap_update_7765_new_computer.ldif SASL/EXTERNAL authentication started SASL username: CN=cscf_accounts_client,OU=Special Accounts,OU=CSCF,DC=sysadmins,DC=cscf,DC=uwaterloo,DC=ca SASL SSF: 0 adding new entry "CN=scspc400_host,OU=Linux Hosts,OU=CS,DC=cs,DC=uwaterloo,DC=ca" Waiting 10 seconds for domain controllers in realm to synchronize 1 The authenticity of host 'scspc400.cs.uwaterloo.ca (129.97.170.65)' can't be established. RSA key fingerprint is 17:9c:eb:dc:f7:58:c7:f4:4b:9a:5e:fc:31:31:ac:6d. Are you sure you want to continue connecting (yes/no)?... Default Kerberos version 5 realm: ENTER #may occur later in the install Should debconf manage LDAP configuration? yes ENTER #this part may not always prompt LDAP server Uniform Resource Identifier: ENTER Please enter the distinguished name of the LDAP search base. Many sites use the components of their domain names for this purpose. For example, the domain "example.net" would use "dc=example,dc=net" as the distinguished name of the search base. Distinguished name of the search base: ENTER Please enter which version of the LDAP protocol should be used by ldapns. It is usually a good idea to set this to the highest available version. 1. 3 2. 2 LDAP version to use: 1 ENTER This option will allow you to make password utilities that use pam to behave like you would be changing local passwords. The password will be stored in a separate file which will be made readable to root only. If you are using NFS mounted /etc or any other custom setup, you should disable this. Make local root Database admin: y ENTER Choose this option if you are required to login to the database to retrieve entries. Note: Under a normal setup, this is not needed. Does the LDAP database require login? n ENTER This account will be used when root changes a password. Note: This account has to be a privileged account. LDAP account for root: ENTER Please enter the password to use when ldap-auth-config tries to login to the LDAP directory using the LDAP account for root. The password will be stored in a separate file /etc/ldap.secret which will be made readable to root only. Entering an empty password will re-use the old password. LDAP root account password: ENTER One or more of the files /etc/pam.d/common-{auth,account,password,session} have been locally modified. Please indicate whether these local changes should be overridden using the system-provided configuration. If you decline this option, you will need to manage your system's authentication configuration by hand. Override local changes to /etc/pam.d/common-*? y ENTER #this part may not always prompt Setting up libpam-ldap (184-8.4ubuntu1) ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype Setting up libnss-ldap (264-2ubuntu2) ... update-rc.d: warning: libnss-ldap start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (none) Reading package lists... Building dependency tree... Reading state information... The following NEW packages will be installed: libpam-krb5 0 upgraded, 1 newly installed, 0 to remove and 71 not upgraded. Need to get 73.8kB of archives. After this operation, 193kB of additional disk space will be used. Get:1 http://mirror.cs.uwaterloo.ca/ubuntu/ maverick/main libpam-krb5 amd64 4.2-1 [73.8kB] debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype dpkg-preconfigure: unable to re-open stdin: Fetched 73.8kB in 0s (2,755kB/s) Selecting previously deselected package libpam-krb5. (Reading database ... 311974 files and directories currently installed.) Unpacking libpam-krb5 (from .../libpam-krb5_4.2-1_amd64.deb) ... Processing triggers for man-db ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype Setting up libpam-krb5 (4.2-1) ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype Reading package lists... Building dependency tree... Reading state information... The following NEW packages will be installed: ntp 0 upgraded, 1 newly installed, 0 to remove and 71 not upgraded. Need to get 556kB of archives. After this operation, 1,442kB of additional disk space will be used. Get:1 http://mirror.cs.uwaterloo.ca/ubuntu/ maverick-updates/main ntp amd64 1:4.2.4p8+dfsg-1ubuntu6.1 [556kB] debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype dpkg-preconfigure: unable to re-open stdin: Fetched 556kB in 0s (9,770kB/s) Selecting previously deselected package ntp. (Reading database ... 311989 files and directories currently installed.) Unpacking ntp (from .../ntp_1%3a4.2.4p8+dfsg-1ubuntu6.1_amd64.deb) ... Processing triggers for ureadahead ... Processing triggers for man-db ... Default Kerberos version 5 realm: ENTER Setting up libpam-krb5 (4.5-3) ... debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype Setting up ntp (1:4.2.4p8+dfsg-1ubuntu6.1) ... Configuration file `/etc/ntp.conf' ==> File on system created by you or by a script. ==> File also in package provided by package maintainer. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** ntp.conf (Y/I/N/O/D/Z) [default=N] ? ENTER * Starting NTP server ntpd ...done. Reading package lists... Building dependency tree... Reading state information... nscd is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 71 not upgraded. * Stopping NTP server ntpd ...done. 2 Sep 14:13:12 ntpdate[7168]: step time server 129.97.152.10 offset -1.334914 sec * Starting NTP server ntpd ...done. * Stopping Name Service Cache Daemon nscd ...done. * Starting Name Service Cache Daemon nscd ...done. no crontab for root active-directory-computer-creation_ldap_update_26940_crontab_update2.txt 100% 117 0.1KB/s 00:00 ---------------------------------------- Creating keytab file on scspc400.cs.uwaterloo.ca ----------------------------------------
cscf.cs# ssh scspc400 root@scspc400:~# klist Ticket cache: FILE:/tmp/krb5cc_0 Default principal: host/ubuntu_scspc400.cs.uwaterloo.ca@CS.UWATERLOO.CA Valid starting Expires Service principal 09/21/11 15:23:29 09/22/11 01:23:30 krbtgt/CS.UWATERLOO.CA@CS.UWATERLOO.CA renew until 09/22/11 15:23:29 root@scspc400:~# root@scspc400:~# klist -k Keytab name: WRFILE:/etc/krb5.keytab KVNO Principal ---- -------------------------------------------------------------------------- 1 host/ubuntu_scspc400.cs.uwaterloo.ca@CS.UWATERLOO.CA 1 host/ubuntu_scspc400.cs.uwaterloo.ca@CS.UWATERLOO.CA 1 host/ubuntu_scspc400.cs.uwaterloo.ca@CS.UWATERLOO.CA 1 host/ubuntu_scspc400.cs.uwaterloo.ca@CS.UWATERLOO.CA 1 host/ubuntu_scspc400.cs.uwaterloo.ca@CS.UWATERLOO.CA 1 host/ubuntu_scspc400.cs.uwaterloo.ca@CS.UWATERLOO.CA oot@scspc400:~# getent passwd ctucker ctucker:*:8324:8324:ctucker:/u4/ctucker:/xhbin/csh root@scspc400:~#If no ticket is obtained it may be that the krb5-user file is not installed. See "Problems and Solutions" below.
root@scspc400:~# tail -f /var/log/auth.log ... Sep 21 15:27:12 scspc400 sshd[7473]: PAM adding faulty module: /lib/security/pam_foreground.so Sep 21 15:27:17 scspc400 sshd[7473]: pam_krb5(sshd:auth): pam_sm_authenticate: entry (0x1) Sep 21 15:27:17 scspc400 sshd[7473]: pam_krb5(sshd:auth): (user gboerke) attempting authentication as gboerke@CS.UWATERLOO.CA Sep 21 15:27:17 scspc400 sshd[7473]: pam_krb5(sshd:auth): user gboerke authenticated as gboerke@CS.UWATERLOO.CA Sep 21 15:27:17 scspc400 sshd[7473]: pam_krb5(sshd:auth): pam_sm_authenticate: exit (success) Sep 21 15:27:17 scspc400 sshd[7473]: Accepted password for gboerke from 129.97.15.216 port 55623 ssh2 Sep 21 15:27:18 scspc400 sshd[7473]: pam_krb5(sshd:setcred): pam_sm_setcred: entry (0x2) Sep 21 15:27:18 scspc400 sshd[7473]: pam_krb5(sshd:setcred): (user gboerke) initializing ticket cache FILE:/tmp/krb5cc_1619_zB7473 Sep 21 15:27:18 scspc400 sshd[7473]: pam_krb5(sshd:setcred): pam_sm_setcred: exit (success) Sep 21 15:27:18 scspc400 sshd[7473]: pam_mkhomedir(sshd:session): unknown option: mask=0022 Sep 21 15:27:18 scspc400 sshd[7473]: pam_krb5(sshd:session): pam_sm_open_session: entry (0x0) Sep 21 15:27:18 scspc400 sshd[7473]: pam_krb5(sshd:session): pam_sm_open_session: exit (success) Sep 21 15:27:18 scspc400 sshd[7477]: pam_krb5(sshd:setcred): pam_sm_setcred: entry (0x2) Sep 21 15:27:18 scspc400 sshd[7477]: pam_krb5(sshd:setcred): pam_sm_setcred: exit (success)
gboerke@herbert:~$ ssh gboerke@scspc400 The authenticity of host 'scspc400 (129.97.170.65)' can't be established. RSA key fingerprint is 17:9c:eb:dc:f7:58:c7:f4:4b:9a:5e:fc:31:31:ac:6d. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'scspc400,129.97.170.65' (RSA) to the list of known hosts. gboerke@scspc400's password: %
root@scspc400:~# crontab -l 39 13 * * * /usr/bin/kinit -k host/ubuntu_scspc400.cs.uwaterloo.ca@CS.UWATERLOO.CA 0-55/5 * * * * /root/nscdcheck.sh
root@scspc400:/etc/security# vi access.conf Add this... + : root cscf-adm : cron crond :0 tty1 tty2 tty3 tty4 tty5 tty6 + : cscf-adm root : ALL + : staff_cscf : ALL + : users_plg : ALL - : ALL : ALL
root@scspc400:/etc# visudo Add this... # CSCF Staff sudoer privileges %staff_cscf ALL=(ALL) ALL # PLG Admins sudoer privileges %admin_plg ALL=(ALL) ALL userid ALL=(ALL) ALL%userid is the user's group and should not be included in the /etc/sudoers file. Note: this allows users sudo access in a terminal session, but not in the GUI. Add the userid to the sudo group in /etc/group in Ubuntu 12.04 and later versions. Add the userid to the admin group in /etc/group in Ubuntu OS versions prior to 12.04
root@scspc400:/etc# useradd userid sudo root@scspc400:/etc# useradd userid admin
---------------------------------------- Creating keytab file on rsg-pc062.cs.uwaterloo.ca ---------------------------------------- rm: cannot remove `/etc/krb5.keytab': No such file or directory bash: ktutil: command not found chown: cannot access `/etc/krb5.keytab': No such file or directory chmod: cannot access `/etc/krb5.keytab': No such file or directory bash: kinit: command not found cscf.cs#At the machine run "klist" and it will show that "apt-get install krb5-user" must be run. This may require enabling the sources list via "Ubuntu Software Centre" in the main menu or System > Administration > Update Manager > Settings button.
cd /u/userid
. So, we will create pointers from u, u1-u9 into /home:
root@scspc239:/xhbin# for i in u u1 u2 u3 u4 u5 u6 u7 u8 u9; do ln -s /home /$i; done root@scspc239:/xhbin# ls -ld /u* lrwxrwxrwx 1 root root 5 2009-10-26 10:25 /u -> /home lrwxrwxrwx 1 root root 5 2009-10-26 10:25 /u1 -> /home lrwxrwxrwx 1 root root 5 2009-10-26 10:25 /u2 -> /home lrwxrwxrwx 1 root root 5 2009-10-26 10:25 /u3 -> /home lrwxrwxrwx 1 root root 5 2009-10-26 10:25 /u4 -> /home lrwxrwxrwx 1 root root 5 2009-10-26 10:25 /u5 -> /home lrwxrwxrwx 1 root root 5 2009-10-26 10:25 /u6 -> /home lrwxrwxrwx 1 root root 5 2009-10-26 10:25 /u7 -> /home lrwxrwxrwx 1 root root 5 2009-10-26 10:25 /u8 -> /home lrwxrwxrwx 1 root root 5 2009-10-26 10:25 /u9 -> /home root@scspc239:/xhbin#
root@scspc368:/# ls -al xhbin total 8 drwxr-xr-x 2 root root 4096 May 14 06:31 . drwxr-xr-x 26 root root 4096 May 14 06:35 .. lrwxrwxrwx 1 root root 9 May 14 06:31 bash -> /bin/bash lrwxrwxrwx 1 root root 8 May 14 06:31 csh -> /bin/csh lrwxrwxrwx 1 root root 9 May 14 06:31 dash -> /bin/dash lrwxrwxrwx 1 root root 10 May 14 06:31 false -> /bin/false lrwxrwxrwx 1 root root 8 May 14 06:31 ksh -> /bin/ksh lrwxrwxrwx 1 root root 7 May 14 06:31 sh -> /bin/sh lrwxrwxrwx 1 root root 9 May 14 06:31 tcsh -> /bin/tcsh lrwxrwxrwx 1 root root 8 May 14 06:31 zsh -> /bin/zsh
[SeatDefaults] user-session=ubuntu greeter-session=unity-greeter autologin-user= greeter-show-manual-login=true allow-guest=false
The current solution is to log into a Solaris machine and set the shell. You can find the unix attributes for a user by going into AD (login to najas for CS-GENERAL) and open the MMC Console: * Start -> Run: mmc * File -> Add&Remove Snapin o Click Add o Select: ADSI Edit -> Click: Add o Close -> OK * Right-Click ADSI Edit o Select: Connect To: o A dialogue box should appear with Path: LDAP://VIRIDIS.cs.uwaterloo.ca/Domain o Click: OK * Note: if you want to keep this handy, click File -> Save As -> save to your desktop; MMC Console.mmc (or similar) * Click [+] to open: ADSI Edit -> Domain -> DC -> OU=CS -> OU=Users * Scroll down to the user you are interested in * Right-click on the user -> Properties o Unix uid: uidNumber o Unix gid: gidNumber o Home directory: unixHomeDirectory o Shell: loginShell-- GordBoerke - 21 Sep 2012