IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

Linux Shadow Password HOWTO

Search Howtos :Match :
Next Previous Contents

4. Compiling the programs.

4.1 Unpacking the archive.

The first step after retrieving the package is unpacking it. The package is in the tar (tape archive) format and compressed using gzip, so first move it to /usr/src, then type:

tar -xzvf shadow-current.tar.gz

This will unpack it into the directory: /usr/src/shadow-YYMMDD

4.2 Configuring with the config.h file

The first thing that you need to do is to copy over the Makefile and the config.h file:

cd /usr/src/shadow-YYMMDD
cp Makefile.linux Makefile
cp config.h.linux config.h

You should then take a look at the config.h file. This file contains definitions for some of the configuration options. If you are using the recommended package, I recommend that you disable group shadow support for your first time around.

By default shadowed group passwords are enabled. To disable these edit the config.h file, and change the #define SHADOWGRP to #undef SHADOWGRP. I recommend that you disable them to start with, and then if you really want group passwords and group administrators that you enable it later and recompile. If you leave it enabled, you must create the file /etc/gshadow.

Enabling the long passwords option is NOT recommended as discussed above.

Do NOT change the setting: #undef AUTOSHADOW

The AUTOSHADOW option was originally designed so that programs that were shadow ignorant would still function. This sounds good in theory, but does not work correctly. If you enable this option, and the program runs as root, it may call getpwnam() as root, and later write the modified entry back to the /etc/passwd file (with the no-longer-shadowed password). Such programs include chfn and chsh. (You can't get around this by swapping real and effective uid before calling getpwnam() because root may use chfn and chsh too.)

The same warning is also valid if you are building libc, it has a SHADOW_COMPAT option which does the same thing. It should NOT be used! If you start getting encoded passwords back in your /etc/passwd file, this is the problem.

If you are using a libc version prior to 4.6.27, you will need to make a couple more changes to config.h and the Makefile. To config.h edit and change:

#define HAVE_BASENAME
to:
#undef HAVE_BASENAME
And then in the Makefile, change:

SOBJS = smain.o env.o entry.o susetup.o shell.o \
        sub.o mail.o motd.o sulog.o age.o tz.o hushed.o

SSRCS = smain.c env.c entry.c setup.c shell.c \
        pwent.c sub.c mail.c motd.c sulog.c shadow.c age.c pwpack.c rad64.c \
        tz.c hushed.c
SOBJS = smain.o env.o entry.o susetup.o shell.o \
        sub.o mail.o motd.o sulog.o age.o tz.o hushed.o basename.o

SSRCS = smain.c env.c entry.c setup.c shell.c \
        pwent.c sub.c mail.c motd.c sulog.c shadow.c age.c pwpack.c rad64.c \
        tz.c hushed.c basename.c
These changes add the code contained in basename.c which is contained in libc 4.6.27 and later.

4.3 Making backup copies of your original programs.

It would also be a good idea to track down and make backup copies of the programs that the shadow suite will replace. On a Slackware 3.0 system these are:

  • /bin/su
  • /bin/login
  • /usr/bin/passwd
  • /usr/bin/newgrp
  • /usr/bin/chfn
  • /usr/bin/chsh
  • /usr/bin/id

The BETA package has a save target in the Makefile, but it's commented out because different distributions place the programs in different places.

You should also make a backup copy of your /etc/passwd file, but be careful to name it something else if you place it in the same directory so you don't overwrite the passwd command.

4.4 Running make

You need to be logged as root to do most of the installation.

Run make to compile the executables in the package:

make all

You may see the warning: rcsid defined but not used. This is fine, it just happens because the author is using a version control package.


Next Previous Contents
Search Howtos :Match :
My Money 2.0.49
Personal financial software
Linux Kernel 2.6 2.6.32-rc8
Linux Kernel
GCstar 1.5.0
Personal collections manager
ImageMagick 6.5.7.9
ImageMagick image processing studio
BibleTime 2.4
Bible study software for Linux / KDE
PHP 5.3.1
Server-side, cross-platform, HTML embedded scripting language.
LFTP 4.0.4
Shell-like command line ftp client.
Tellico 2.1.1
Collection manager for books, music, videos, and bibliographies
Totem 2.28.4
Movie player for Gnome
GNOME 2.29.2
GNOME desktop environment
Free IT Magazines, White Papers, eBooks, and more !
Oracle Magazine

Contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more.

Vulnerability Management for Dummies

Get all the Facts and See How to Implement a Successful Vulnerability Management Program.

Website Magazine

Has tapped premier talent in the Internet industry for our content and each and every issue will contain practical advice and insights for website owners.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info