Locking a password does not stop someone with an SSH key. When a person leaves or an account must go dark right now, I’d expire the account itself.
An account with an expiry date in the past is refused by PAM at every login, whatever the method. Setting the date with --expiredate, or -e for short, to day 1 (2 January 1970) does exactly that:
sudo usermod --expiredate 1 bob
sudo chage -l bob | grep 'Account expires'
The second line confirms it. You should see Account expires : Jan 02, 1970. Files, crontab and home folder stay where they are, so you can still look through them or hand them over later.
To give the account back, clear the date again:
sudo usermod --expiredate '' bob
I like this better than deleting a user in a hurry. Deleting loses the evidence and frees the UID for the next new account, which can then end up owning the old files.
Keep in mind that this only blocks new logins. Sessions that are already open keep running, so check w and end them with loginctl terminate-user bob. Processes the user left behind, like a tmux session or a cron job, are a separate story too.
Further reading: usermod(8) manual page, chage(1) manual page