0

I changed my .ssh/authorized_keys2 file and now I can no longer log in via ssh. When trying to connect, it immediately says "Connection closed by...".

Is there a way to ignore the change to authorized_key2 file so I can avoid bothering the root system admin?

Tristan
  • 103
  • 1
  • 3

3 Answers3

4

This command should tell the ssh command to ignore your the keys in ~/.ssh/ :

ssh -o PreferredAuthentications=keyboard-interactive -o PubkeyAuthentication=no host1.example.org

However in my experience, this doesn't work everywhere.

I borrowed this answer from SSH use only my password, Ignore my ssh key, don't prompt me for a passphrase

Stefan Lasiewski
  • 22,949
  • 38
  • 129
  • 184
1

If you just want to fail back to password login, you'll have to remove the keys from your local client's SSH directories. If they're not present, and the SSH server is configured to allow password logins, you'll get presented with a password login. This should allow you to change things so they work.

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
0

ssh -i keyfile user@host where keyfile contains a key not present on the remote host will prompt for a password. Just create a new one if you don't have an alternate keyfile handy.

dldnh
  • 103
  • 4