0

Ssh into an ec2 instance worked for me yesterday. Now, the same key seems to not work today. Nothing has changed as far as I know:

I have a running agent

I did

ssh-add followed by ssh-add -l and it works too but the real ssh command returns the (Permission denied)

when I do ssh -vvv then it shows the log below to me:

Authentications that can continue: publickey
debug1: Trying private key: /u/.ssh/id_rsa
debug3: no such identity: /u/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /u/.ssh/id_dsa
debug3: no such identity: /u/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /u/.ssh/id_ecdsa
debug3: no such identity: /u/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /u/.ssh/id_ed25519
debug3: no such identity: /u/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.

I am new to Linux and have not idea what is going on. what does it even mean?

1
  • Where is the key you used to log in to your ec instance? What is the output of ssh-add -l?
    – Jakuje
    Jun 2, 2017 at 6:14

1 Answer 1

0

Running ssh-add a second time bombed your original keys. So, your current key is not the same one that worked yesterday.

It might be easier to just start over and then not disturb your key(s) once you have them working. Enter the following commands:

  • ssh-keygen -t rsa -b 4096 -C "key_label" - this will generate key pair;

  • Hit the Enter key when prompted to save the key file;

  • Enter your desired passphrase when prompted or just hit Enter for no passphrase;

  • eval "$(ssh-agent -s)" - verify that the ssh-agent is running;

  • ssh-add ~/.ssh/id_rsa - add your new ssh key to the ssh-agent.

1
  • How running ssh-add can bomb your keys? Wft?
    – Jakuje
    Jun 2, 2017 at 6:14

You must log in to answer this question.

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