4

I was trying to figure out how to add a new SSH key to my amazon server - I found this question and answer

How do you copy the public key to a ssh-server?

However I am so new to Linux/Unix and I overthink things so I thought the following

  1. Since my clients access this server if I mess this up I am going to have serious problems recovering.
  2. How could this possibly work because I have no connection to that other server. I read the first response and it suggests that I could send my newly generated public key to any server in the land.

Does my second point make sense. The command from the shell (which I just installed) reads to me as

  1. ssh - use an ssh session
  2. copy the key to (in my case it would be ubuntu@ourspecial.server.com (hosted by Amazon though I am not sure it matters)

In other words - for a totally new user the command suggests that if I use the following command

$ ssh-copy-id tim@just.some.other.server

if there is actually a user named tim and a server named just.some.other.server

I would then have some privileges at that server

And so I finally tried the command and clearly there is something missing as when I keyed in

$ ssh-copy-id ubuntu@my.amazonserver.com

the shell returned

/usr/bin/ssh-copy-id: ERROR: No identities found
PyNEwbie
  • 1,569

2 Answers2

5
/usr/bin/ssh-copy-id: ERROR: No identities found

This command only works if you have an identity previously created via ssh-keygen.

"Common threads: OpenSSH key management, Part 1"

0

First use below command on the source server:

ssh-keygen

Output as below:

Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:

After that use, the ssh-copy-id command, should work.

fra-san
  • 10,205
  • 2
  • 22
  • 43