X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;ds=sidebyside;f=fai%2Fconfig%2Fscripts%2FDEBIAN%2F10-rootpw;h=539f2eb6c3badfe173022b0f7fc0e05959bdfebd;hb=591c84435e22df12f2b5121c08578bff7c6bb047;hp=bb77d1a30f5fe0eb2df8dc43d5abbfc8b80dcdb3;hpb=3d9cc96092cdc8aa05bc95cf83c07bb1af692013;p=automated-distro-installer diff --git a/fai/config/scripts/DEBIAN/10-rootpw b/fai/config/scripts/DEBIAN/10-rootpw index bb77d1a..539f2eb 100755 --- a/fai/config/scripts/DEBIAN/10-rootpw +++ b/fai/config/scripts/DEBIAN/10-rootpw @@ -4,11 +4,9 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code # set root password if [ -n "$ROOTPW" ]; then - $ROOTCMD usermod -p "$ROOTPW" root -else + $ROOTCMD chpasswd --encrypted <<< "root:${ROOTPW}" +elif [ -n "$username" ]; then $ROOTCMD usermod -L root - # enable sudo for user - ainsl /etc/sudoers "$username ALL = ALL" fi exit $error