I normally ssh into a remote server, for which I previously set an option that allows me not to type my password every time. Now that I forgot it, is there any way to retrieve it?

1 Answer 1


No. User account passwords on Unix systems are saved with one-way encryption and cannot be retrieved. They can only be reset. You will need to login as root or some other privileged account and reset the password for your user.

  • 1
    @Bob: To complete Caleb's answer, you've been using public key authentication, which is based on a different set of credentials, not on your password. Your password can only be retrieved by brute force. Ask the server administrator to let you change it. May 7, 2011 at 12:05
  • @Gilles: I thought of suggesting that, but decided there was a good chance that his ssh client was just using a password manager rather than that he actually got public key authentication setup. If your guess is correct and its' his passphrase rather than password that's been forgotten, he would need to make a new key pair.
    – Caleb
    May 7, 2011 at 12:13
  • I followed these instructions for passwordless ssh oit.uci.edu/computing/bduc/newuser.html#passwordless
    – zzzbbx
    May 7, 2011 at 12:21
  • @Bob: Yes, you're using a public key. I understood your question to mean that you can still access the server with ssh, but can't log in locally because you've forgotten your password. Could you clarify your question, to indicate which of Caleb's or my interpretation is right? May 7, 2011 at 12:26
  • 1
    @Bob if @Gilles is right and you can still get into the box via ssh and your key but don't know the local password, you have a shot to reset the password yourself without the root admin doing it for you by running sudo passwd USERNAME. If sudo asks your for your password you are out of luck, but if it was configured not to ask, you would be able to reset your password without having to enter the old one first (normally required).
    – Caleb
    May 7, 2011 at 12:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .