I have an account i SSH into. How do i switch to using a plain old password to login rather than my public/private key pair?

  • 6
    Why do you want to do this?
    – sciurus
    Aug 12, 2011 at 21:42
  • 3
    This is a terrible idea. I don't approve. Aug 12, 2011 at 21:43
  • 3
    Is the next step re-enabling Telnet? (WHY do you want to do this?)
    – voretaq7
    Aug 12, 2011 at 21:54
  • 2
    Can you clarify whether you are asking how to 1) Enable password authentication on a server where it is disabled or 2) Tell your ssh client to try password authentication before trying public key authentication? Shane's answer is appropriate if you're trying for #1, mine is for #2.
    – sciurus
    Aug 12, 2011 at 22:38
  • 1
    One general problem with a private key is that you have no idea how it is being handled by clients. They could be carrying the private key around unencrypted on a USB memory for all I know. Passwords are good because they can be forced to adhere to a policy on a creation time.
    – Ztyx
    Sep 23, 2015 at 8:52

3 Answers 3


The PasswordAuthentication option in the /etc/ssh/sshd_config file controls whether passwords are allowed.

Really, though. Use public keys.

  • 3
    The question is about disabling public key on client side not server side. Apr 5, 2017 at 12:58

If you want to do this temporarily, you could connect to the server with ssh -o 'PubkeyAuthentication no' server. If you want to do this permanently, on the server you could remove your public key from ~/.ssh/authorized_keys or on your computer you could add the following to ~/.ssh/config

Hostname server
PubkeyAuthentication no


if you know the password it should be a matter of supplying the password... if you dont know it and have access to the system, simply reset it by running


to force it to use password login, you will have to remove your private key file from its currently location (linux/mac) or disable it in your ssh client

you also need to check that password auth is enabled in your ssh config

however i also echo the other comments, switching from key auth to password is NOT recommended as you are effectively lowering your level of security, i would be asking why you are making this kind of switch

  • This is not a good answer to the question
    – Richard
    Sep 18, 2015 at 8:51
  • I agree. I have a user with a dual boot, windows or linux. The keys were set up on linux butnot windows. This has meant no git access for the machine when in windows
    – Robin
    Oct 19, 2020 at 8:45

You must log in to answer this question.

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