0

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

https://alvinalexander.com/linux-unix/how-use-scp-without-password-backups-copy

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?

1
  • 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, 2018 at 19:33

1 Answer 1

3

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

You must log in to answer this question.

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