diff options
Diffstat (limited to 'chapter8/shadow.sh')
-rw-r--r-- | chapter8/shadow.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/chapter8/shadow.sh b/chapter8/shadow.sh new file mode 100644 index 0000000..3e2bdd5 --- /dev/null +++ b/chapter8/shadow.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# shellcheck disable=SC2016 +ROOTPW='$1$5RPAAd$oejpw8ErihLIB7vmGE4SV1' + +# shellcheck disable=SC2016 +sed -i 's/groups$(EXEEXT) //' src/Makefile.in +find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \; +find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \; +find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \; + +sed -e 's:#ENCRYPT_METHOD DES:ENCRYPT_METHOD SHA512:' \ + -e 's:/var/spool/mail:/var/mail:' \ + -i etc/login.defs + +sed -i 's/1000/999/' etc/useradd + +touch /usr/bin/passwd +./configure --sysconfdir=/etc \ + --with-group-name-max-length=32 + +make +make -j1 install + +pwconv +grpconv + +usermod -p "${ROOTPW}" root |