Score:0

The .ssh/authorized_keys

tr flag

My question and perplexity relates to .ssh/authorized_keys

I have multiple EC2 instances (some created from the Ubuntu 20x AMI or the Amazon Linux AMI)

On one such Ubuntu EC2 and I need to to supplement the default authorized_keys with one public key (of a particular special server) created specifically (using ssh-keygen).

I observed on the Ubuntu 20.x.x it was impossible (scp, nano, chmod and all that it did not help)

But doing this on an Instance of Amazon Linux 2, it was a piece of cake.

  1. After a SSH into the instance, did a chmod of the file to 700.
  2. Opened it in nano
  3. Copied and pasted the public key I wished, saved and
  4. restored the chmod to 400

alternative to nano was

$ cat 'public-Key' >> .ssh/authorized_keys 

PS: From my special server I intended to achieve execution of a script such as

ssh -J <bastion-server with port> <userName@target-server> ./myScript.sh

Any clues ?

Has anybody gone thru this experience?

thanks

hr flag
What do you mean exactly by *"it was impossible"*? What happened when you tried?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.