Expire Account

How you can disable user

usermod --expiredate 1 vpupkin

or

usermod -L -e 1 vpupkin

How youcan enable the user

sudo usermod --expiredate "" vpupkin

or

sudo usermod -U -e "" vpupkin
Lock a Password

But this doesn’t work for ssh with ssh-key

Lock password for user

passwd -l vpupkin

Unlock password for user

passwd -u vpupkin
Expire a Password
passwd -e YYYY-MM-DD vpupkin