From 4c72c4877f5226096df4f7c15cb73c5adb93055d Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Thu, 16 Oct 2014 20:12:34 +0100 Subject: vyatta-cfg-system: fix for 'user vyos doesn't exist' on password reset If you delete the vyos user from the system and then go into password reset mode on reboot, the configuration entry for the vyos user is recreated but the command returns 'usermod: user 'vyos' does not exist'. Despite this message the user is created correctly on a full reboot, just not at the point the command is run. Bug #342 http://bugzilla.vyos.net/show_bug.cgi?id=342 --- scripts/standalone_root_pw_reset | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/standalone_root_pw_reset b/scripts/standalone_root_pw_reset index 910a141d..dc12a4d6 100755 --- a/scripts/standalone_root_pw_reset +++ b/scripts/standalone_root_pw_reset @@ -52,8 +52,9 @@ change_password() { fi done + # set the password for the user then store it in the config + # so the user is recreated on the next full system boot. local epwd=$(mkpasswd -H md5 "$pwd1") - usermod -p $epwd $user # escape any slashes in resulting password local eepwd=$(sed 's:/:\\/:g' <<< $epwd) set_encrypted_password $user $eepwd $CF -- cgit v1.2.3