Linux HOWTOs

About | Home | Search


HOWTO: shadow
Description: Shadow password suite
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# shadow 4.0.7
# ============
# Slackware 8.1, 9.0, 9.1, 10.0, and 10.1's 'shadow' packages include
# version 4.0.3

# Prerequisites:
# gawk
# bison
# cracklib, Linux-PAM (optional)
# libiconv
# gettext

# A while back I created a patch that would allow shadow with shared
# libraries _and_ PAM support, but haven't used it since.  Here it is if you
# want to do this:
# http://englanders.cc/pub/linux/patches/shadow-4.0.3-pamfix.patch
# (the build would totally fail without the patch)

cd
test -f installed/shadow-4.0.7.tar.bz2 && mv installed/shadow-4.0.7.tar.bz2 .
test ! -f shadow-4.0.7.tar.bz2 &&
 wget ftp://ftp.pld.org.pl/software/shadow/shadow-4.0.7.tar.bz2
cd /usr/local/src
find -type d -maxdepth 1 -name "shadow-*" -exec rm -r {} \;
tar xjvf ~/shadow-4.0.7.tar.bz2
cd shadow-4.0.7
chown -R root.root .
find -type d -exec chmod 755 {} \;
find -type f -perm 664 -exec chmod 644 {} \;
find -type f -perm 775 -exec chmod 755 {} \;

# If you want to build shadow with PAM support, add --with-libpam to the
# configure line below and see the bottom for info about /etc/pam.d files.

./configure --prefix=/usr --disable-shared --disable-desrpc --disable-nls
make
removepkg shadow
find /usr/share/locale -type f -name "shadow.mo" -exec rm {} \;
make install
install -s src/sulogin /sbin/
ln -sf /sbin/sulogin /bin/sulogin
install -m 644 man/sulogin.8 /usr/man/man8/
ln -sf /usr/sbin/vipw /usr/sbin/vigr
rm -f /bin/vipw
test -f /bin/sg && mv -f /bin/sg /usr/bin/
test -f /etc/limits && mv -f /etc/limits /etc/limits.old
test -f /etc/login.access && mv -f /etc/login.access /etc/login.access.old
test -f /etc/login.defs && mv -f /etc/login.defs /etc/login.defs.old
install -m 644 etc/limits etc/login.access /etc/
install -m 644 etc/login.defs.linux /etc/login.defs

# Grab and install the latest adduser script from slackware-current:
wget http://englanders.cc/pub/linux/slackware/slackware-current/source/a/\
shadow/adduser &&
 install -o root -g bin adduser /usr/sbin/

cd
mkdir -p -m 0700 installed
rm -f installed/shadow-*.tar.*
mv shadow-4.0.7.tar.bz2 installed/

# If you use PAM and don't already have these set up (if you do, it'll blow
# them away):
test -d /etc/pam.d &&
 ( cd /etc/pam.d
   wget http://englanders.cc/pub/linux/misc/shadow-pamfiles.tgz &&
    tar xzvf shadow-pamfiles.tgz &&
     rm -f shadow-pamfiles.tgz
   test -f passwd.noldap && ln -sf passwd.noldap passwd
   test -f su.noldap && ln -sf su.noldap su )

# Note:
# faillog is in /usr/bin here, /usr/sbin in slack (last time I checked)
# lastlog is in /usr/bin here, /usr/sbin in slack (")

Back to the list


Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>