I have key-pairs to ssh and scp into a server without entering my password. There are numerous tutorials on this, e.g.


I would like to now set up an environment whereby this key-pair doesn't exist for some debugging. I don't want to delete they key-pair I already have though, because that's a pain. It's requires much deleting/resetting of keys in ~/.ssh/id_rsa.pub, of which I have many.

Is it possible to ssh into the server in such a way such that the key-pair will be ignored? Is there a convenient way to enter in a "blank slate" for debugging connection issues?

  • Any user that doesn't have a private key that corresponds to the public key(s) in the target machine's ~/.ssh/authorized_keys file should be prompted for regular password authentication. – ivanivan Feb 2 '18 at 19:33

You can turn off public key authentication on a per-connection basis (and also disable connection sharing so that the new session does not connect over an already established one) via:

$ ssh -o ControlPath=none -o PubkeyAuthentication=no serverhost
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.