Slackware 12.0 - Pluggable Authentication Module(PAM) - using ssh as an example =============================================================================== Public domain ******************************************************************************** ### PAM cd /usr/src wget http://www.kernel.org/pub/linux/libs/pam/pre/library/Linux-PAM-0.99.10.0.tar.gz tar zxf Linux-PAM-0.99.10.0.tar.gz cd Linux-PAM-0.99.10.0 ./configure && make && make install && ldconfig grep -v cracklib conf/pam.conf > /etc/pam.conf ******************************************************************************** ### /etc/pam.conf sshd auth required /lib/security/pam_unix.so shadow nodelay sshd auth required /lib/security/pam_nologin.so sshd account required /lib/security/pam_unix.so sshd password required /lib/security/pam_unix.so shadow nullok use_authtok sshd session required /lib/security/pam_unix.so sshd session required /lib/security/pam_limits.so ******************************************************************************** ### LibHX cd /usr/src/ wget "http://downloads.sourceforge.net/project/libhx/libHX/2.9/libHX-2.9.tar.bz2?use_mirror=dfn" tar jxf libHX-2.9.tar.bz2 cd libHX-2.9 ./configure && make && make install && ldconfig ******************************************************************************** ### pam_mount cd /usr/src wget "http://downloads.sourceforge.net/project/pam-mount/pam_mount/1.27/pam_mount-1.27.tar.bz2?use_mirror=garr" tar jxf pam_mount-1.27.tar.bz2 cd pam_mount-1.27 ./configure && make && make install ******************************************************************************** ### Pam Modules bookmark: [http://www.kernel.org/pub/linux/libs/pam/modules.html](http://www.kernel.org/pub/linux/libs/pam/modules.html) ******************************************************************************** ### pamtester cd /usr/src wget "http://downloads.sourceforge.net/project/pamtester/pamtester/0.1.2/pamtester-0.1.2.tar.gz?use_mirror=garr" tar zxf pamtester-0.1.2.tar.gz cd pamtester-0.1.2 ./configure && make && make install ******************************************************************************** ### util-linux download and prepare cd /usr/src wget http://www.kernel.org/pub/linux/utils/util-linux/util-linux-2.12r.tar.gz wget http://lfs.vlsm.org/lfs/conglomeration/util-linux/util-linux-2.12r-lseek-1.patch tar zxf util-linux-2.12r.tar.gz cd util-linux-2.12r ******************************************************************************** ### MCONFIG HAVE_PAM=yes ******************************************************************************** ### util-linux installation patch -p1 < ../util-linux-2.12r-lseek-1.patch make cd login-utils make login cp /bin/login{,.bak} cp login /usr/bin if [ -a /bin/login ]; then cp login /bin; fi ******************************************************************************** ### /etc/securetty vc/1 vc/2 vc/3 vc/4 vc/5 vc/6 ******************************************************************************** ### sshd cd /usr/src wget http://anga.funkfeuer.at/ftp/pub/OpenBSD/OpenSSH/portable/openssh-5.2p1.tar.gz tar zxf openssh-5.2p1.tar.gz cd openssh-5.2p1 ./configure \ --prefix=/usr \ --mandir=/usr/man \ --sysconfdir=/etc/ssh \ --with-pam \ --with-md5-passwords \ --with-tcp-wrappers \ --with-default-path=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin \ --with-ipv4-default \ --with-privsep-path=/var/empty \ --with-privsep-user=sshd \ --build=i386-slackware-linux make /etc/rc.d/rc.sshd stop removepkg openssh make install ******************************************************************************** ### /etc/ssh/sshd_config UsePAM yes ******************************************************************************** ### start sshd /etc/rc.d/rc.sshd start ******************************************************************************** _BY: Pejman Moghadam_ _TAG: pam, ssh, util-linux_ _DATE: 2009-08-05 10:43:42_