X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=46c5d43aa5efd6fae6fc3ceaea8b58e4447770fe;hp=b890f4ca21259bbc4ad0d0df3d1e828779a7fd2a;hb=5afe60315c73b5943152c79c3f4c64dae5699a42;hpb=8a3d2ff3a55bf5fe28e1bce5c2fcc79d0a54a2b2 diff --git a/autoconfig.functions b/autoconfig.functions index b890f4c..46c5d43 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -1053,7 +1053,7 @@ if checkbootparam 'ssh' ; then SSH_PASSWD='' SSH_PASSWD="$(getbootparam 'ssh' 2>>$DEBUG)" config_userlocal - einfo "Bootoption ssh found, trying to set password for user $localuser" + einfo "Bootoption ssh found, trying to set password for root and user $localuser" [ -z "$localuser" ] && eend 1 eindent if [ -z "$SSH_PASSWD" ] ; then @@ -1082,11 +1082,12 @@ if checkbootparam 'ssh' ; then # finally check if we have a password we can use: if [ -n "$SSH_PASSWD" ] ; then # chpasswd sucks, seriously. + chpass_options="" if chpasswd --help 2>&1 | grep -q -- '-m,' ; then - echo "$localuser:$SSH_PASSWD" | chpasswd -m - else - echo "$localuser:$SSH_PASSWD" | chpasswd + chpass_options="-m" fi + echo "$localuser:$SSH_PASSWD" | chpasswd $chpass_options + echo "root:$SSH_PASSWD" | chpasswd $chpass_options fi einfo "Starting secure shell server in background for user $localuser"