AWS CDA EC2 - SSH Commands in Instant Terminal

I am trying to do the EC2 lab using the Instant Terminal, but when I copied the PEM key and ran the chmod and SSH commands to log into the EC2 instance, I get the "ssh: Exited: String too long" error. What should I do to be able to log into my EC2 instance?

  • post-author-pic
    Chad C

    Hello Chris, In order to add a pem key to your ssh client within instant terminal, type "add_key".  Then paste in the contents of your key into the terminal window (this will require you to open the existing key in vim or nano). Press i to insert, then paste your key at the very top of the file. Press 'Esc' then :wq to save your file. Your key will be saved to the default key location (.ssh/id_key). It will be automatically used when you ssh. 

    I hope this helps.  Please let us know how it goes! 

  • post-author-pic
    Aaron R

    I've followed the same directions, but I'm getting two errors:
    Error: File does not begin with OpenSSH key header
    Error reading key from '/root/inputkey'

Looking For Team Training?

Learn More