I am connecting to machine via ssh key and have sudo rights. How can I check that username password I know is correct?
/etc/shadow doesnt' contain me.
What else can be done?
I am connecting to machine via ssh key and have sudo rights. How can I check that username password I know is correct?
/etc/shadow doesnt' contain me.
What else can be done?
Invoke passwd. You should be asked your current password; provide the password you know.
Wrong password will make the command fail immediately. Correct password will allow you to set a new password. Set a new password by typing it twice or deliberately type two different strings to leave the password unchanged.
Does su "$USER" ask for a password? It may not but if it does, provide the password you know.
Wrong password will make the command fail with Authentication failure. Correct password will give you a shell (exit it with exit).
You might be using directory services and not be using a local account. In that case you won't find an entry in /etc/shadow.
Check passwd entry in /etc/nsswitch.conf for that.
It is possible to skip key authentication with SSH using
ssh -o "PubkeyAuthentication=no" <host>
This way you can try to login with your password*
*) if other authentication mechanisms are not in place. Otherwise you can use -o "PreferredAuthentications=password" to force password authentication