Page 1 of 1

BUG: Suspend option lock all accounts

Posted: Sun Jul 05, 2015 1:55 am
by kijamve
Hi, i suspend an account (ingeniumve) and all accounts in my vps is locked (and root user!), see the auth.log:


Jul 4 19:51:57 cuado sudo: admin : TTY=unknown ; PWD=/usr/local/vesta/web/suspend/user ; USER=ro
ot ; COMMAND=/usr/local/vesta/bin/v-suspend-user ingeniumve
Jul 4 19:51:57 cuado usermod[23409]: lock user 'ingeniumve' password
Jul 4 19:51:57 cuado usermod[23417]: lock user 'root' password
Jul 4 19:51:57 cuado usermod[23512]: lock user 'bind' password
Jul 4 19:51:57 cuado usermod[23517]: lock user 'fetchmail' password
Jul 4 19:51:57 cuado usermod[23522]: lock user 'sshd' password
Jul 4 19:51:57 cuado usermod[23527]: lock user 'syslog' password
Jul 4 19:51:57 cuado usermod[23532]: lock user 'klog' password
Jul 4 19:51:57 cuado usermod[23537]: lock user 'smmta' password
Jul 4 19:51:57 cuado usermod[23542]: lock user 'smmsp' password
Jul 4 19:51:57 cuado usermod[23562]: lock user 'dovecot' password
Jul 4 19:51:57 cuado usermod[23567]: lock user 'dovenull' password
Jul 4 19:51:57 cuado usermod[23572]: lock user 'ftp' password
Jul 4 19:51:57 cuado usermod[23577]: lock user 'admin' password
... one line by user ...

Re: BUG: Suspend option lock all accounts

Posted: Sun Jul 05, 2015 2:07 am
by kijamve
This commit is wrong:

https://github.com/serghey-rodin/vesta/ ... 83d3181fe7

Fix is:

for ftp in $(grep ^`echo $user`_.* /etc/passwd| cut -f 1 -d : ); do


To unlock all accounts, execute this command (re-suspend all accounts after this fix):

for fix in $(grep ^.* /etc/passwd| cut -f 1 -d : ); do
/usr/sbin/usermod --unlock $fix
done

Re: BUG: Suspend option lock all accounts

Posted: Sat Sep 05, 2015 2:35 pm
by b1tg0d
I had the exact same issue. I could not SSH because even [root] was locked. Is there a permanent fix for this bug? I don't want to suspend an account again until I know it won't lockout root again.

For anyone who wants to suspend an account you should first login as root then:

nano /usr/local/vesta/bin/v-suspend-user

change
for ftp in $(grep ^$user_.* /etc/passwd| cut -f 1 -d : ); do

to
for ftp in $(grep ^`echo $user`_.* /etc/passwd| cut -f 1 -d : ); do

ctrl+x and save the file.

If you did suspend an account, and got locked out - once you have root access again run the fix script kijamve wrote above. Thanks kijamve for finding this hopefully the fix will be in the next Vesta update.

Re: BUG: Suspend option lock all accounts

Posted: Tue Sep 15, 2015 6:39 pm
by peshte
Same bug here.
But, I run the command v-unsuspend-user on a user (which was not suspended), and all the passwords were restored.