To Lock a user account
$ sudo passwd -l username
To UnLock a user account
$ sudo passwd -u username
Root can log into locked account using su - username but can't log in using ssh.
Other users can't log into locked account using su - username as well as ssh.
The message is displayed when users try to access the locked account.
su: Authentication failure