OnWorks Linux and Windows Online WorkStations

Logo

Free Hosting Online for WorkStations

< Previous | Contents | Next >

6.20.1. Installation of Shadow


Note

If you would like to enforce the use of strong passwords, refer to http://www.linuxfromscratch.org/blfs/view/ 9.0/postlfs/cracklib.html for installing CrackLib prior to building Shadow. Then add --with-libcrack to the configure command below.

Note

If you would like to enforce the use of strong passwords, refer to http://www.linuxfromscratch.org/blfs/view/ 9.0/postlfs/cracklib.html for installing CrackLib prior to building Shadow. Then add --with-libcrack to the configure command below.

image

{}

{}

Disable the installation of the groups program and its man pages, as Coreutils provides a better version. Also Prevent the installation of manual pages that were already installed in Section 6.8, “Man-pages-5.02”:


sed -i 's/groups$(EXEEXT) //' src/Makefile.in

sed -i 's/groups$(EXEEXT) //' src/Makefile.in


find man -name Makefile.in -exec sed -i find man -name Makefile.in -exec sed -i

find man -name Makefile.in -exec sed -i

's/groups\.1 / 's/getspnam\.3

's/passwd\.5 /

/'

\;

\;

\;

find man -name Makefile.in -exec sed -i find man -name Makefile.in -exec sed -i

find man -name Makefile.in -exec sed -i

/ /' {}

/'

/ /' {}

/'

{}

{}

Instead of using the default crypt method, use the more secure SHA-512 method of password encryption, which also allows passwords longer than 8 characters. It is also necessary to change the obsolete /var/spool/mail location for user mailboxes that Shadow uses by default to the /var/mail location used currently:


sed -i -e 's@#ENCRYPT_METHOD DES@ENCRYPT_METHOD SHA512@' \

-e 's@/var/spool/mail@/var/mail@' etc/login.defs

sed -i -e 's@#ENCRYPT_METHOD DES@ENCRYPT_METHOD SHA512@' \

-e 's@/var/spool/mail@/var/mail@' etc/login.defs


Note

If you chose to build Shadow with Cracklib support, run the following:

Note

If you chose to build Shadow with Cracklib support, run the following:


image

sed -i 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' etc/login.defs

sed -i 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' etc/login.defs

Make a minor change to make the first group number generated by useradd 1000:


sed -i 's/1000/999/' etc/useradd

sed -i 's/1000/999/' etc/useradd


Prepare Shadow for compilation:


./configure --sysconfdir=/etc --with-group-name-max-length=32

./configure --sysconfdir=/etc --with-group-name-max-length=32


The meaning of the configure option:


--with-group-name-max-length=32

The maximum user name is 32 characters. Make the maximum group name the same.

Compile the package:


make

make


This package does not come with a test suite. Install the package:


make install

make install

Move a misplaced program to its proper location:


mv -v /usr/bin/passwd /bin

mv -v /usr/bin/passwd /bin


Top OS Cloud Computing at OnWorks: