From 156b283772b7c2fa228f8b5896eee0cd2f12f477 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 31 Aug 2016 11:57:02 +0200 Subject: include shadowconvert.sh in sources --- shadowconvert.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 shadowconvert.sh diff --git a/shadowconvert.sh b/shadowconvert.sh new file mode 100755 index 0000000..4be13b6 --- /dev/null +++ b/shadowconvert.sh @@ -0,0 +1,18 @@ +#!/bin/bash +if [ x`pwd` = "x/etc" ] +then + echo Cannot operate directly on \"/etc\". >&2 + exit 1 +fi + +#make prototype for /etc/shadow +sed -e "s/:.*/:*:`expr $(date +%s) / 86400`:0:99999:7:::/" passwd >shadow + +#make prototype for /etc/gshadow +sed -e 's/:[0-9]\+:/::/g' group >gshadow + +#mark passwd and group files entries shadowed +sed -i -e 's/^\([^:]\+\):[^:]*:/\1:x:/' passwd group + +echo Converted successfully. +exit 0 -- cgit v1.2.1