The default encryption algorithm can be defined for the system with
the <option>ENCRYPT_METHOD</option> variable of
<filename>/etc/login.defs</filename>, and can be overwritten with the
- <option>-e</option>, <option>-m</option>, or <option>-c</option>
+ <option>-e</option> or <option>-c</option>
options.
</para>
<para condition="pam">
By default, passwords are encrypted by PAM, but (even if not
recommended) you can select a different encryption method with the
- <option>-e</option>, <option>-m</option>, or <option>-c</option>
+ <option>-e</option> or <option>-c</option>
options.
</para>
<para>
By default, PAM is used to encrypt the passwords.
</para>
<para condition="no_pam">
- By default (if none of the <option>-c</option>,
- <option>-m</option>, or <option>-e</option> options are
+ By default (if none of the <option>-c</option>
+ or <option>-e</option> options are
specified), the encryption method is defined by the
<option>ENCRYPT_METHOD</option> variable of
<filename>/etc/login.defs</filename>.
</varlistentry>
</variablelist>
<variablelist remap='IP'>
- <varlistentry>
- <term><option>-m</option>, <option>--md5</option></term>
- <listitem>
- <para>
- Use MD5 encryption instead of DES when the supplied passwords are
- not encrypted.
- </para>
- </listitem>
- </varlistentry>
<varlistentry>
<term>
<option>-R</option>, <option>--root</option> <replaceable>CHROOT_DIR</replaceable>
*/
static const char Prog[] = "chpasswd";
static bool eflg = false;
-static bool md5flg = false;
static bool sflg = false;
static /*@null@*//*@observer@*/const char *crypt_method = NULL;
);
(void) fputs (_(" -e, --encrypted supplied passwords are encrypted\n"), usageout);
(void) fputs (_(" -h, --help display this help message and exit\n"), usageout);
- (void) fputs (_(" -m, --md5 encrypt the clear text password using\n"
- " the MD5 algorithm\n"),
- usageout);
(void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
(void) fputs (_(" -P, --prefix PREFIX_DIR directory prefix\n"), usageout);
(void) fputs (_(" -s, --sha-rounds number of rounds for the SHA, BCRYPT\n"
{"crypt-method", required_argument, NULL, 'c'},
{"encrypted", no_argument, NULL, 'e'},
{"help", no_argument, NULL, 'h'},
- {"md5", no_argument, NULL, 'm'},
{"root", required_argument, NULL, 'R'},
{"prefix", required_argument, NULL, 'P'},
{"sha-rounds", required_argument, NULL, 's'},
{NULL, 0, NULL, '\0'}
};
- while (-1 != (c = getopt_long(argc, argv, "c:ehmR:P:s:", long_options, NULL)))
+ while (-1 != (c = getopt_long(argc, argv, "c:ehR:P:s:", long_options, NULL)))
{
switch (c) {
case 'c':
case 'h':
usage (E_SUCCESS);
/*@notreached@*/break;
- case 'm':
- md5flg = true;
- break;
case 'R': /* no-op, handled in process_root_flag () */
flags->chroot = true;
break;
usage (E_USAGE);
}
- if ((eflg && (md5flg || cflg)) ||
- (md5flg && cflg)) {
+ if (eflg && cflg) {
fprintf (stderr,
- _("%s: the -c, -e, and -m flags are exclusive\n"),
+ _("%s: the -c and -e flags are exclusive\n"),
Prog);
usage (E_USAGE);
}
return NULL;
}
- if (md5flg) {
- crypt_method = "MD5";
- }
if (sflg) {
if (IS_CRYPT_METHOD("SHA256") || IS_CRYPT_METHOD("SHA512")) {
arg = &sha_rounds;
prefix = process_prefix_flag ("-P", argc, argv);
#ifdef USE_PAM
- if (md5flg || eflg || cflg || prefix[0]) {
+ if (eflg || cflg || prefix[0]) {
use_pam = false;
}
#endif /* USE_PAM */
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-. ../../common/config.sh
-. ../../common/log.sh
-
-log_start "$0" "Add a new user"
-
-save_config
-
-# restore the files on exit
-trap 'log_status "$0" "FAILURE"; restore_config' 0
-
-change_config
-
-echo -n "Create user test1 (useradd test1)..."
-echo nobody:test | chpasswd -m
-echo "OK"
-
-echo -n "Check the passwd file..."
-../../common/compare_file.pl 06_chpasswd-m/passwd /etc/passwd
-echo "OK"
-echo -n "Check the group file..."
-../../common/compare_file.pl 06_chpasswd-m/group /etc/group
-echo "OK"
-echo -n "Check the shadow file..."
-../../common/compare_file.pl 06_chpasswd-m/shadow /etc/shadow
-echo "OK"
-echo -n "Check the gshadow file..."
-../../common/compare_file.pl 06_chpasswd-m/gshadow /etc/gshadow
-echo "OK"
-
-log_status "$0" "SUCCESS"
-restore_config
-trap '' 0
-
+++ /dev/null
-root:x:0:
-daemon:x:1:
-bin:x:2:
-sys:x:3:
-adm:x:4:
-tty:x:5:
-disk:x:6:
-lp:x:7:
-mail:x:8:
-news:x:9:
-uucp:x:10:
-man:x:12:
-proxy:x:13:
-kmem:x:15:
-dialout:x:20:
-fax:x:21:
-voice:x:22:
-cdrom:x:24:
-floppy:x:25:
-tape:x:26:
-sudo:x:27:
-audio:x:29:
-dip:x:30:
-www-data:x:33:
-backup:x:34:
-operator:x:37:
-list:x:38:
-irc:x:39:
-src:x:40:
-gnats:x:41:
-shadow:x:42:
-utmp:x:43:
-video:x:44:
-sasl:x:45:
-plugdev:x:46:
-staff:x:50:
-games:x:60:
-users:x:100:
-nogroup:x:65534:
-crontab:x:101:
-Debian-exim:x:102:
+++ /dev/null
-root:*::
-daemon:*::
-bin:*::
-sys:*::
-adm:*::
-tty:*::
-disk:*::
-lp:*::
-mail:*::
-news:*::
-uucp:*::
-man:*::
-proxy:*::
-kmem:*::
-dialout:*::
-fax:*::
-voice:*::
-cdrom:*::
-floppy:*::
-tape:*::
-sudo:*::
-audio:*::
-dip:*::
-www-data:*::
-backup:*::
-operator:*::
-list:*::
-irc:*::
-src:*::
-gnats:*::
-shadow:*::
-utmp:*::
-video:*::
-sasl:*::
-plugdev:*::
-staff:*::
-games:*::
-users:*::
-nogroup:*::
-crontab:x::
-Debian-exim:x::
+++ /dev/null
-root:x:0:0:root:/root:/bin/bash
-daemon:x:1:1:daemon:/usr/sbin:/bin/sh
-bin:x:2:2:bin:/bin:/bin/sh
-sys:x:3:3:sys:/dev:/bin/sh
-sync:x:4:65534:sync:/bin:/bin/sync
-games:x:5:60:games:/usr/games:/bin/sh
-man:x:6:12:man:/var/cache/man:/bin/sh
-lp:x:7:7:lp:/var/spool/lpd:/bin/sh
-mail:x:8:8:mail:/var/mail:/bin/sh
-news:x:9:9:news:/var/spool/news:/bin/sh
-uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
-proxy:x:13:13:proxy:/bin:/bin/sh
-www-data:x:33:33:www-data:/var/www:/bin/sh
-backup:x:34:34:backup:/var/backups:/bin/sh
-list:x:38:38:Mailing List Manager:/var/list:/bin/sh
-irc:x:39:39:ircd:/var/run/ircd:/bin/sh
-gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
-nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
-Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+++ /dev/null
-root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
-daemon:*:12977:0:99999:7:::
-bin:*:12977:0:99999:7:::
-sys:*:12977:0:99999:7:::
-sync:*:12977:0:99999:7:::
-games:*:12977:0:99999:7:::
-man:*:12977:0:99999:7:::
-lp:*:12977:0:99999:7:::
-mail:*:12977:0:99999:7:::
-news:*:12977:0:99999:7:::
-uucp:*:12977:0:99999:7:::
-proxy:*:12977:0:99999:7:::
-www-data:*:12977:0:99999:7:::
-backup:*:12977:0:99999:7:::
-list:*:12977:0:99999:7:::
-irc:*:12977:0:99999:7:::
-gnats:*:12977:0:99999:7:::
-nobody:@PASS_MD5 test@:@TODAY@:0:99999:7:::
-Debian-exim:!:12977:0:99999:7:::
run_test ./usertools/chpasswd-PAM/05_chpasswd_error_no_password/chpasswd.test
run_test ./usertools/chpasswd-PAM/06_chpasswd_usage/chpasswd.test
run_test ./usertools/chpasswd-PAM/07_chpasswd_usage_bad_option/chpasswd.test
- run_test ./usertools/chpasswd-PAM/08_chpasswd_usage-e-m_exclusive/chpasswd.test
run_test ./usertools/chpasswd-PAM/09_chpasswd_usage-e-c_exclusive/chpasswd.test
- run_test ./usertools/chpasswd-PAM/10_chpasswd_usage-m-c_exclusive/chpasswd.test
run_test ./usertools/chpasswd-PAM/11_chpasswd_usage-s_without-c/chpasswd.test
run_test ./usertools/chpasswd-PAM/12_chpasswd_usage-s_invalid/chpasswd.test
run_test ./usertools/chpasswd-PAM/13_chpasswd_usage-c_invalid/chpasswd.test
run_test ./usertools/chpasswd-PAM/14_chpasswd_password_encrypted/chpasswd.test
- run_test ./usertools/chpasswd-PAM/15_chpasswd_password_md5/chpasswd.test
run_test ./usertools/chpasswd-PAM/16_chpasswd_password_NONE/chpasswd.test
run_test ./usertools/chpasswd-PAM/17_chpasswd_password_MD5/chpasswd.test
run_test ./usertools/chpasswd-PAM/18_chpasswd_password_DES/chpasswd.test
fi
run_test ./usertools/chpasswd-PAM/06_chpasswd_usage/chpasswd.test
run_test ./usertools/chpasswd-PAM/07_chpasswd_usage_bad_option/chpasswd.test
-run_test ./usertools/chpasswd-PAM/08_chpasswd_usage-e-m_exclusive/chpasswd.test
run_test ./usertools/chpasswd-PAM/09_chpasswd_usage-e-c_exclusive/chpasswd.test
-run_test ./usertools/chpasswd-PAM/10_chpasswd_usage-m-c_exclusive/chpasswd.test
run_test ./usertools/chpasswd-PAM/11_chpasswd_usage-s_without-c/chpasswd.test
run_test ./usertools/chpasswd-PAM/12_chpasswd_usage-s_invalid/chpasswd.test
run_test ./usertools/chpasswd-PAM/13_chpasswd_usage-c_invalid/chpasswd.test
run_test ./crypt/login.defs_DES/03_chpasswd--crypt-method-DES.test
run_test ./crypt/login.defs_DES/04_chpasswd--crypt-method-NONE.test
run_test ./crypt/login.defs_DES/05_chpasswd-e.test
- run_test ./crypt/login.defs_DES/06_chpasswd-m.test
fi
run_test ./crypt/login.defs_DES/07_chgpasswd.test
run_test ./crypt/login.defs_DES/08_chgpasswd--crypt-method-MD5.test
run_test ./usertools/chpasswd-PAM/05_chpasswd_error_no_password/chpasswd.test
run_test ./usertools/chpasswd-PAM/06_chpasswd_usage/chpasswd.test
run_test ./usertools/chpasswd-PAM/07_chpasswd_usage_bad_option/chpasswd.test
- run_test ./usertools/chpasswd-PAM/08_chpasswd_usage-e-m_exclusive/chpasswd.test
run_test ./usertools/chpasswd-PAM/09_chpasswd_usage-e-c_exclusive/chpasswd.test
- run_test ./usertools/chpasswd-PAM/10_chpasswd_usage-m-c_exclusive/chpasswd.test
run_test ./usertools/chpasswd-PAM/11_chpasswd_usage-s_without-c/chpasswd.test
run_test ./usertools/chpasswd-PAM/12_chpasswd_usage-s_invalid/chpasswd.test
run_test ./usertools/chpasswd-PAM/13_chpasswd_usage-c_invalid/chpasswd.test
run_test ./usertools/chpasswd-PAM/14_chpasswd_password_encrypted/chpasswd.test
- run_test ./usertools/chpasswd-PAM/15_chpasswd_password_md5/chpasswd.test
run_test ./usertools/chpasswd-PAM/16_chpasswd_password_NONE/chpasswd.test
run_test ./usertools/chpasswd-PAM/17_chpasswd_password_MD5/chpasswd.test
run_test ./usertools/chpasswd-PAM/18_chpasswd_password_DES/chpasswd.test
fi
run_test ./usertools/chpasswd-PAM/06_chpasswd_usage/chpasswd.test
run_test ./usertools/chpasswd-PAM/07_chpasswd_usage_bad_option/chpasswd.test
-run_test ./usertools/chpasswd-PAM/08_chpasswd_usage-e-m_exclusive/chpasswd.test
run_test ./usertools/chpasswd-PAM/09_chpasswd_usage-e-c_exclusive/chpasswd.test
-run_test ./usertools/chpasswd-PAM/10_chpasswd_usage-m-c_exclusive/chpasswd.test
run_test ./usertools/chpasswd-PAM/11_chpasswd_usage-s_without-c/chpasswd.test
run_test ./usertools/chpasswd-PAM/12_chpasswd_usage-s_invalid/chpasswd.test
run_test ./usertools/chpasswd-PAM/13_chpasswd_usage-c_invalid/chpasswd.test
run_test ./crypt/login.defs_DES/03_chpasswd--crypt-method-DES.test
run_test ./crypt/login.defs_DES/04_chpasswd--crypt-method-NONE.test
run_test ./crypt/login.defs_DES/05_chpasswd-e.test
- run_test ./crypt/login.defs_DES/06_chpasswd-m.test
fi
run_test ./crypt/login.defs_DES/07_chgpasswd.test
run_test ./crypt/login.defs_DES/08_chgpasswd--crypt-method-MD5.test
-c, --crypt-method METHOD the crypt method (one of NONE DES MD5 SHA256 SHA512)
-e, --encrypted supplied passwords are encrypted
-h, --help display this help message and exit
- -m, --md5 encrypt the clear text password using
- the MD5 algorithm
-R, --root CHROOT_DIR directory to chroot into
-s, --sha-rounds number of SHA rounds for the SHA*
crypt algorithms
-c, --crypt-method METHOD the crypt method (one of NONE DES MD5 SHA256 SHA512)
-e, --encrypted supplied passwords are encrypted
-h, --help display this help message and exit
- -m, --md5 encrypt the clear text password using
- the MD5 algorithm
-R, --root CHROOT_DIR directory to chroot into
-s, --sha-rounds number of SHA rounds for the SHA*
crypt algorithms
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-. ../../../common/config.sh
-. ../../../common/log.sh
-
-log_start "$0" "chpasswd checks that -e and -m are not provided at the same time"
-
-save_config
-
-# restore the files on exit
-trap 'log_status "$0" "FAILURE"; restore_config' 0
-
-change_config
-
-echo -n "Password are encrypted and must use md5 (chpasswd -m -e)..."
-echo 'nobody:test' | chpasswd -m -e 2>tmp/usage.out && exit 1 || {
- status=$?
-}
-echo "OK"
-
-echo -n "Check returned status ($status)..."
-test "$status" = "2"
-echo "OK"
-
-echo "chpasswd reported:"
-echo "======================================================================="
-cat tmp/usage.out
-echo "======================================================================="
-echo -n "Check the usage message..."
-diff -au data/usage.out tmp/usage.out
-echo "usage message OK."
-rm -f tmp/usage.out
-
-echo -n "Check the passwd file..."
-../../../common/compare_file.pl config/etc/passwd /etc/passwd
-echo "OK"
-echo -n "Check the group file..."
-../../../common/compare_file.pl config/etc/group /etc/group
-echo "OK"
-echo -n "Check the shadow file..."
-../../../common/compare_file.pl config/etc/shadow /etc/shadow
-echo "OK"
-echo -n "Check the gshadow file..."
-../../../common/compare_file.pl config/etc/gshadow /etc/gshadow
-echo "OK"
-
-log_status "$0" "SUCCESS"
-restore_config
-trap '' 0
-
+++ /dev/null
-# no testsuite password
-# root password: rootF00barbaz
-# myuser password: myuserF00barbaz
-
-user foo, in group users (only in /etc/group)
-user foo, in group tty (only in /etc/gshadow)
-user foo, in group floppy
-user foo, admin of group disk
-user foo, admin and member of group fax
-user foo, admin and member of group cdrom (only in /etc/gshadow)
+++ /dev/null
-# Default values for useradd(8)
-#
-# The SHELL variable specifies the default login shell on your
-# system.
-# Similar to DHSELL in adduser. However, we use "sh" here because
-# useradd is a low level utility and should be as general
-# as possible
-SHELL=/bin/foobar
-#
-# The default group for users
-# 100=users on Debian systems
-# Same as USERS_GID in adduser
-# This argument is used when the -n flag is specified.
-# The default behavior (when -n and -g are not specified) is to create a
-# primary user group with the same name as the user being added to the
-# system.
-GROUP=10
-#
-# The default home directory. Same as DHOME for adduser
-HOME=/tmp
-#
-# The number of days after a password expires until the account
-# is permanently disabled
-INACTIVE=12
-#
-# The default expire date
-EXPIRE=2007-12-02
-#
-# The SKEL variable specifies the directory containing "skeletal" user
-# files; in other words, files such as a sample .profile that will be
-# copied to the new user's home directory when it is created.
-# SKEL=/etc/skel
-#
-# Defines whether the mail spool should be created while
-# creating the account
-# CREATE_MAIL_SPOOL=yes
+++ /dev/null
-root:x:0:
-daemon:x:1:
-bin:x:2:
-sys:x:3:
-adm:x:4:
-tty:x:5:
-disk:x:6:
-lp:x:7:
-mail:x:8:
-news:x:9:
-uucp:x:10:
-man:x:12:
-proxy:x:13:
-kmem:x:15:
-dialout:x:20:
-fax:x:21:
-voice:x:22:
-cdrom:x:24:
-floppy:x:25:
-tape:x:26:
-sudo:x:27:
-audio:x:29:
-dip:x:30:
-www-data:x:33:
-backup:x:34:
-operator:x:37:
-list:x:38:
-irc:x:39:
-src:x:40:
-gnats:x:41:
-shadow:x:42:
-utmp:x:43:
-video:x:44:
-sasl:x:45:
-plugdev:x:46:
-staff:x:50:
-games:x:60:
-users:x:100:
-nogroup:x:65534:
-crontab:x:101:
-Debian-exim:x:102:
+++ /dev/null
-root:*::
-daemon:*::
-bin:*::
-sys:*::
-adm:*::
-tty:*::
-disk:*::
-lp:*::
-mail:*::
-news:*::
-uucp:*::
-man:*::
-proxy:*::
-kmem:*::
-dialout:*::
-fax:*::
-voice:*::
-cdrom:*::
-floppy:*::
-tape:*::
-sudo:*::
-audio:*::
-dip:*::
-www-data:*::
-backup:*::
-operator:*::
-list:*::
-irc:*::
-src:*::
-gnats:*::
-shadow:*::
-utmp:*::
-video:*::
-sasl:*::
-plugdev:*::
-staff:*::
-games:*::
-users:*::
-nogroup:*::
-crontab:x::
-Debian-exim:x::
+++ /dev/null
-root:x:0:0:root:/root:/bin/bash
-daemon:x:1:1:daemon:/usr/sbin:/bin/sh
-bin:x:2:2:bin:/bin:/bin/sh
-sys:x:3:3:sys:/dev:/bin/sh
-sync:x:4:65534:sync:/bin:/bin/sync
-games:x:5:60:games:/usr/games:/bin/sh
-man:x:6:12:man:/var/cache/man:/bin/sh
-lp:x:7:7:lp:/var/spool/lpd:/bin/sh
-mail:x:8:8:mail:/var/mail:/bin/sh
-news:x:9:9:news:/var/spool/news:/bin/sh
-uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
-proxy:x:13:13:proxy:/bin:/bin/sh
-www-data:x:33:33:www-data:/var/www:/bin/sh
-backup:x:34:34:backup:/var/backups:/bin/sh
-list:x:38:38:Mailing List Manager:/var/list:/bin/sh
-irc:x:39:39:ircd:/var/run/ircd:/bin/sh
-gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
-nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
-Debian-exim:x:102:102::/var/spool/exim4:/bin/false
-foo:x:1000:1000::/nonexistent:/bin/sh
+++ /dev/null
-root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
-daemon:*:12977:0:99999:7:::
-bin:*:12977:0:99999:7:::
-sys:*:12977:0:99999:7:::
-sync:*:12977:0:99999:7:::
-games:*:12977:0:99999:7:::
-man:*:12977:0:99999:7:::
-lp:*:12977:0:99999:7:::
-mail:*:12977:0:99999:7:::
-news:*:12977:0:99999:7:::
-uucp:*:12977:0:99999:7:::
-proxy:*:12977:0:99999:7:::
-www-data:*:12977:0:99999:7:::
-backup:*:12977:0:99999:7:::
-list:*:12977:0:99999:7:::
-irc:*:12977:0:99999:7:::
-gnats:*:12977:0:99999:7:::
-nobody:*:12977:0:99999:7:::
-Debian-exim:!:12977:0:99999:7:::
+++ /dev/null
-chpasswd: the -c, -e, and -m flags are exclusive
-Usage: chpasswd [options]
-
-Options:
- -c, --crypt-method METHOD the crypt method (one of NONE DES MD5 SHA256 SHA512)
- -e, --encrypted supplied passwords are encrypted
- -h, --help display this help message and exit
- -m, --md5 encrypt the clear text password using
- the MD5 algorithm
- -R, --root CHROOT_DIR directory to chroot into
- -s, --sha-rounds number of SHA rounds for the SHA*
- crypt algorithms
-
-chpasswd: the -c, -e, and -m flags are exclusive
+chpasswd: the -c and -e flags are exclusive
Usage: chpasswd [options]
Options:
-c, --crypt-method METHOD the crypt method (one of NONE DES MD5 SHA256 SHA512)
-e, --encrypted supplied passwords are encrypted
-h, --help display this help message and exit
- -m, --md5 encrypt the clear text password using
- the MD5 algorithm
-R, --root CHROOT_DIR directory to chroot into
-s, --sha-rounds number of SHA rounds for the SHA*
crypt algorithms
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-. ../../../common/config.sh
-. ../../../common/log.sh
-
-log_start "$0" "chpasswd checks that -c and -m are not provided at the same time"
-
-save_config
-
-# restore the files on exit
-trap 'log_status "$0" "FAILURE"; restore_config' 0
-
-change_config
-
-echo -n "Password must use md5 and another method (chpasswd -m -c SHA256)..."
-echo 'nobody:test' | chpasswd -m -c SHA256 2>tmp/usage.out && exit 1 || {
- status=$?
-}
-echo "OK"
-
-echo -n "Check returned status ($status)..."
-test "$status" = "2"
-echo "OK"
-
-echo "chpasswd reported:"
-echo "======================================================================="
-cat tmp/usage.out
-echo "======================================================================="
-echo -n "Check the usage message..."
-diff -au data/usage.out tmp/usage.out
-echo "usage message OK."
-rm -f tmp/usage.out
-
-echo -n "Check the passwd file..."
-../../../common/compare_file.pl config/etc/passwd /etc/passwd
-echo "OK"
-echo -n "Check the group file..."
-../../../common/compare_file.pl config/etc/group /etc/group
-echo "OK"
-echo -n "Check the shadow file..."
-../../../common/compare_file.pl config/etc/shadow /etc/shadow
-echo "OK"
-echo -n "Check the gshadow file..."
-../../../common/compare_file.pl config/etc/gshadow /etc/gshadow
-echo "OK"
-
-log_status "$0" "SUCCESS"
-restore_config
-trap '' 0
-
+++ /dev/null
-# no testsuite password
-# root password: rootF00barbaz
-# myuser password: myuserF00barbaz
-
-user foo, in group users (only in /etc/group)
-user foo, in group tty (only in /etc/gshadow)
-user foo, in group floppy
-user foo, admin of group disk
-user foo, admin and member of group fax
-user foo, admin and member of group cdrom (only in /etc/gshadow)
+++ /dev/null
-# Default values for useradd(8)
-#
-# The SHELL variable specifies the default login shell on your
-# system.
-# Similar to DHSELL in adduser. However, we use "sh" here because
-# useradd is a low level utility and should be as general
-# as possible
-SHELL=/bin/foobar
-#
-# The default group for users
-# 100=users on Debian systems
-# Same as USERS_GID in adduser
-# This argument is used when the -n flag is specified.
-# The default behavior (when -n and -g are not specified) is to create a
-# primary user group with the same name as the user being added to the
-# system.
-GROUP=10
-#
-# The default home directory. Same as DHOME for adduser
-HOME=/tmp
-#
-# The number of days after a password expires until the account
-# is permanently disabled
-INACTIVE=12
-#
-# The default expire date
-EXPIRE=2007-12-02
-#
-# The SKEL variable specifies the directory containing "skeletal" user
-# files; in other words, files such as a sample .profile that will be
-# copied to the new user's home directory when it is created.
-# SKEL=/etc/skel
-#
-# Defines whether the mail spool should be created while
-# creating the account
-# CREATE_MAIL_SPOOL=yes
+++ /dev/null
-root:x:0:
-daemon:x:1:
-bin:x:2:
-sys:x:3:
-adm:x:4:
-tty:x:5:
-disk:x:6:
-lp:x:7:
-mail:x:8:
-news:x:9:
-uucp:x:10:
-man:x:12:
-proxy:x:13:
-kmem:x:15:
-dialout:x:20:
-fax:x:21:
-voice:x:22:
-cdrom:x:24:
-floppy:x:25:
-tape:x:26:
-sudo:x:27:
-audio:x:29:
-dip:x:30:
-www-data:x:33:
-backup:x:34:
-operator:x:37:
-list:x:38:
-irc:x:39:
-src:x:40:
-gnats:x:41:
-shadow:x:42:
-utmp:x:43:
-video:x:44:
-sasl:x:45:
-plugdev:x:46:
-staff:x:50:
-games:x:60:
-users:x:100:
-nogroup:x:65534:
-crontab:x:101:
-Debian-exim:x:102:
+++ /dev/null
-root:*::
-daemon:*::
-bin:*::
-sys:*::
-adm:*::
-tty:*::
-disk:*::
-lp:*::
-mail:*::
-news:*::
-uucp:*::
-man:*::
-proxy:*::
-kmem:*::
-dialout:*::
-fax:*::
-voice:*::
-cdrom:*::
-floppy:*::
-tape:*::
-sudo:*::
-audio:*::
-dip:*::
-www-data:*::
-backup:*::
-operator:*::
-list:*::
-irc:*::
-src:*::
-gnats:*::
-shadow:*::
-utmp:*::
-video:*::
-sasl:*::
-plugdev:*::
-staff:*::
-games:*::
-users:*::
-nogroup:*::
-crontab:x::
-Debian-exim:x::
+++ /dev/null
-root:x:0:0:root:/root:/bin/bash
-daemon:x:1:1:daemon:/usr/sbin:/bin/sh
-bin:x:2:2:bin:/bin:/bin/sh
-sys:x:3:3:sys:/dev:/bin/sh
-sync:x:4:65534:sync:/bin:/bin/sync
-games:x:5:60:games:/usr/games:/bin/sh
-man:x:6:12:man:/var/cache/man:/bin/sh
-lp:x:7:7:lp:/var/spool/lpd:/bin/sh
-mail:x:8:8:mail:/var/mail:/bin/sh
-news:x:9:9:news:/var/spool/news:/bin/sh
-uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
-proxy:x:13:13:proxy:/bin:/bin/sh
-www-data:x:33:33:www-data:/var/www:/bin/sh
-backup:x:34:34:backup:/var/backups:/bin/sh
-list:x:38:38:Mailing List Manager:/var/list:/bin/sh
-irc:x:39:39:ircd:/var/run/ircd:/bin/sh
-gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
-nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
-Debian-exim:x:102:102::/var/spool/exim4:/bin/false
-foo:x:1000:1000::/nonexistent:/bin/sh
+++ /dev/null
-root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
-daemon:*:12977:0:99999:7:::
-bin:*:12977:0:99999:7:::
-sys:*:12977:0:99999:7:::
-sync:*:12977:0:99999:7:::
-games:*:12977:0:99999:7:::
-man:*:12977:0:99999:7:::
-lp:*:12977:0:99999:7:::
-mail:*:12977:0:99999:7:::
-news:*:12977:0:99999:7:::
-uucp:*:12977:0:99999:7:::
-proxy:*:12977:0:99999:7:::
-www-data:*:12977:0:99999:7:::
-backup:*:12977:0:99999:7:::
-list:*:12977:0:99999:7:::
-irc:*:12977:0:99999:7:::
-gnats:*:12977:0:99999:7:::
-nobody:*:12977:0:99999:7:::
-Debian-exim:!:12977:0:99999:7:::
+++ /dev/null
-chpasswd: the -c, -e, and -m flags are exclusive
-Usage: chpasswd [options]
-
-Options:
- -c, --crypt-method METHOD the crypt method (one of NONE DES MD5 SHA256 SHA512)
- -e, --encrypted supplied passwords are encrypted
- -h, --help display this help message and exit
- -m, --md5 encrypt the clear text password using
- the MD5 algorithm
- -R, --root CHROOT_DIR directory to chroot into
- -s, --sha-rounds number of SHA rounds for the SHA*
- crypt algorithms
-
-c, --crypt-method METHOD the crypt method (one of NONE DES MD5 SHA256 SHA512)
-e, --encrypted supplied passwords are encrypted
-h, --help display this help message and exit
- -m, --md5 encrypt the clear text password using
- the MD5 algorithm
-R, --root CHROOT_DIR directory to chroot into
-s, --sha-rounds number of SHA rounds for the SHA*
crypt algorithms
-c, --crypt-method METHOD the crypt method (one of NONE DES MD5 SHA256 SHA512)
-e, --encrypted supplied passwords are encrypted
-h, --help display this help message and exit
- -m, --md5 encrypt the clear text password using
- the MD5 algorithm
-R, --root CHROOT_DIR directory to chroot into
-s, --sha-rounds number of SHA rounds for the SHA*
crypt algorithms
-c, --crypt-method METHOD the crypt method (one of NONE DES MD5 SHA256 SHA512)
-e, --encrypted supplied passwords are encrypted
-h, --help display this help message and exit
- -m, --md5 encrypt the clear text password using
- the MD5 algorithm
-R, --root CHROOT_DIR directory to chroot into
-s, --sha-rounds number of SHA rounds for the SHA*
crypt algorithms
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-. ../../../common/config.sh
-. ../../../common/log.sh
-
-log_start "$0" "chpasswd can use create md5 passwords"
-
-save_config
-
-# restore the files on exit
-trap 'log_status "$0" "FAILURE"; restore_config' 0
-
-change_config
-
-echo -n "Change nobody and lp's password (chpasswd --md5)..."
-echo 'nobody:test
-lp:test2' | chpasswd --md5
-echo "OK"
-
-echo -n "Check the passwd file..."
-../../../common/compare_file.pl config/etc/passwd /etc/passwd
-echo "OK"
-echo -n "Check the group file..."
-../../../common/compare_file.pl config/etc/group /etc/group
-echo "OK"
-echo -n "Check the shadow file..."
-../../../common/compare_file.pl data/shadow /etc/shadow
-echo "OK"
-echo -n "Check the gshadow file..."
-../../../common/compare_file.pl config/etc/gshadow /etc/gshadow
-echo "OK"
-
-log_status "$0" "SUCCESS"
-restore_config
-trap '' 0
-
+++ /dev/null
-root:x:0:
-daemon:x:1:
-bin:x:2:
-sys:x:3:
-adm:x:4:
-tty:x:5:
-disk:x:6:
-lp:x:7:
-mail:x:8:
-news:x:9:
-uucp:x:10:
-man:x:12:
-proxy:x:13:
-kmem:x:15:
-dialout:x:20:
-fax:x:21:
-voice:x:22:
-cdrom:x:24:
-floppy:x:25:
-tape:x:26:
-sudo:x:27:
-audio:x:29:
-dip:x:30:
-www-data:x:33:
-backup:x:34:
-operator:x:37:
-list:x:38:
-irc:x:39:
-src:x:40:
-gnats:x:41:
-shadow:x:42:
-utmp:x:43:
-video:x:44:
-sasl:x:45:
-plugdev:x:46:
-staff:x:50:
-games:x:60:
-users:x:100:
-nogroup:x:65534:
-crontab:x:101:
-Debian-exim:x:102:
+++ /dev/null
-root:*::
-daemon:*::
-bin:*::
-sys:*::
-adm:*::
-tty:*::
-disk:*::
-lp:*::
-mail:*::
-news:*::
-uucp:*::
-man:*::
-proxy:*::
-kmem:*::
-dialout:*::
-fax:*::
-voice:*::
-cdrom:*::
-floppy:*::
-tape:*::
-sudo:*::
-audio:*::
-dip:*::
-www-data:*::
-backup:*::
-operator:*::
-list:*::
-irc:*::
-src:*::
-gnats:*::
-shadow:*::
-utmp:*::
-video:*::
-sasl:*::
-plugdev:*::
-staff:*::
-games:*::
-users:*::
-nogroup:*::
-crontab:x::
-Debian-exim:x::
+++ /dev/null
-#
-# The PAM configuration file for the Shadow `chpasswd' service
-#
-
-@include common-password
-
+++ /dev/null
-#
-# /etc/pam.d/common-password - password-related modules common to all services
-#
-# This file is included from other service-specific PAM config files,
-# and should contain a list of modules that define the services to be
-# used to change user passwords. The default is pam_unix.
-
-# Explanation of pam_unix options:
-#
-# The "md5" option enables MD5 passwords. Without this option, the
-# default is Unix crypt.
-#
-# The "obscure" option replaces the old `OBSCURE_CHECKS_ENAB' option in
-# login.defs.
-#
-# See the pam_unix manpage for other options.
-
-# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
-# To take advantage of this, it is recommended that you configure any
-# local modules either before or after the default block, and use
-# pam-auth-update to manage selection of other modules. See
-# pam-auth-update(8) for details.
-
-# here are the per-package modules (the "Primary" block)
-password [success=1 default=ignore] pam_unix.so obscure
-# here's the fallback if no module succeeds
-password requisite pam_deny.so
-# prime the stack with a positive return value if there isn't one already;
-# this avoids us returning an error just because nothing sets a success code
-# since the modules above will each just jump around
-password required pam_permit.so
-# and here are more per-package modules (the "Additional" block)
-# end of pam-auth-update config
+++ /dev/null
-root:x:0:0:root:/root:/bin/bash
-daemon:x:1:1:daemon:/usr/sbin:/bin/sh
-bin:x:2:2:bin:/bin:/bin/sh
-sys:x:3:3:sys:/dev:/bin/sh
-sync:x:4:65534:sync:/bin:/bin/sync
-games:x:5:60:games:/usr/games:/bin/sh
-man:x:6:12:man:/var/cache/man:/bin/sh
-lp:x:7:7:lp:/var/spool/lpd:/bin/sh
-mail:x:8:8:mail:/var/mail:/bin/sh
-news:x:9:9:news:/var/spool/news:/bin/sh
-uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
-proxy:x:13:13:proxy:/bin:/bin/sh
-www-data:x:33:33:www-data:/var/www:/bin/sh
-backup:x:34:34:backup:/var/backups:/bin/sh
-list:x:38:38:Mailing List Manager:/var/list:/bin/sh
-irc:x:39:39:ircd:/var/run/ircd:/bin/sh
-gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
-nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
-Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+++ /dev/null
-root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
-daemon:*:12977:0:99999:7:::
-bin:*:12977:0:99999:7:::
-sys:*:12977:0:99999:7:::
-sync:*:12977:0:99999:7:::
-games:*:12977:0:99999:7:::
-man:*:12977:0:99999:7:::
-lp:*:12977:0:99999:7:::
-mail:*:12977:0:99999:7:::
-news:*:12977:0:99999:7:::
-uucp:*:12977:0:99999:7:::
-proxy:*:12977:0:99999:7:::
-www-data:*:12977:0:99999:7:::
-backup:*:12977:0:99999:7:::
-list:*:12977:0:99999:7:::
-irc:*:12977:0:99999:7:::
-gnats:*:12977:0:99999:7:::
-nobody:*:12977:0:99999:7:::
-Debian-exim:!:12977:0:99999:7:::
+++ /dev/null
-root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
-daemon:*:12977:0:99999:7:::
-bin:*:12977:0:99999:7:::
-sys:*:12977:0:99999:7:::
-sync:*:12977:0:99999:7:::
-games:*:12977:0:99999:7:::
-man:*:12977:0:99999:7:::
-lp:@PASS_MD5 test2@:@TODAY@:0:99999:7:::
-mail:*:12977:0:99999:7:::
-news:*:12977:0:99999:7:::
-uucp:*:12977:0:99999:7:::
-proxy:*:12977:0:99999:7:::
-www-data:*:12977:0:99999:7:::
-backup:*:12977:0:99999:7:::
-list:*:12977:0:99999:7:::
-irc:*:12977:0:99999:7:::
-gnats:*:12977:0:99999:7:::
-nobody:@PASS_MD5 test@:@TODAY@:0:99999:7:::
-Debian-exim:!:12977:0:99999:7:::