kevin SSH

/usr/bin/ssh-copy-id: ERROR: failed to open ID file

SSH-COPY-ID is unable to find the public and private key pair ... If you renamed the default id_rsa to mykey.key, try to remove the ".key" part of the filename and re-run the command. An alternative is to use the -f…

SSH-COPY-ID is unable to find the public and private key pair ...

If you renamed the default id_rsa to mykey.key, try to remove the ".key" part of the filename and re-run the command. An alternative is to use the -f flag when running ssh-copy-id.

The error


[kevin@fivemin .ssh]$ ssh-copy-id -i ./fivemin.pub root@ip
/usr/bin/ssh-copy-id: ERROR: failed to open ID file './fivemin': No such file or directory
        (to install the contents of './fivemin.pub' anyway, look at the -f option)
Notice how the ssh-copy-id says that it cant find the file "fivemin" (which is the private key in this case)

The folder contents (wrong)

[kevin@fivemin .ssh]$ ls -la
total 24
drwx------. 2 kevin kevin 4096 Feb 23 20:18 .
drwx------. 6 kevin kevin 4096 Feb 23 20:11 ..
-rw-------. 1 kevin kevin 2635 Feb 23 20:12 fivemin.key
-rw-r--r--. 1 kevin kevin  591 Feb 23 20:12 fivemin.pub
-rw-------. 1 kevin kevin 1701 Feb 21 20:10 known_hosts
-rw-------. 1 kevin kevin  959 Feb 21 20:10 known_hosts.old
[kevin@fivemin .ssh]$
~/.ssh/

Change filename

[kevin@fivemin .ssh]$ mv fivemin.key fivemin

The folder contents (correct)

[kevin@fivemin .ssh]$ ls -la
total 24
drwx------. 2 kevin kevin 4096 Feb 23 20:18 .
drwx------. 6 kevin kevin 4096 Feb 23 20:11 ..
-rw-------. 1 kevin kevin 2635 Feb 23 20:12 fivemin
-rw-r--r--. 1 kevin kevin  591 Feb 23 20:12 fivemin.pub
-rw-------. 1 kevin kevin 1701 Feb 21 20:10 known_hosts
-rw-------. 1 kevin kevin  959 Feb 21 20:10 known_hosts.old
[kevin@fivemin .ssh]$

Rerun ssh-copy-id (now works)

[kevin@fivemin .ssh]$ ssh-copy-id -i ./fivemin.pub root@ip
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "./fivemin.pub"