BUG: Suspend option lock all accounts
BUG: Suspend option lock all accounts
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 ...
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
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
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
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.
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
Same bug here.
But, I run the command v-unsuspend-user on a user (which was not suspended), and all the passwords were restored.
But, I run the command v-unsuspend-user on a user (which was not suspended), and all the passwords were restored.