I would propose mentioning ssh-copy-id over manually editing ~/.ssh/authorized_keys.
ssh-copy-id
~/.ssh/authorized_keys
ssh-copy-id takes the same -i argument, so if you use a non-standard location for your key, lets say ~/foo/bar/id_rsa and ~/foo/bar/id_rsa.pub, then
-i
~/foo/bar/id_rsa
~/foo/bar/id_rsa.pub
$ ssh-copy-id -i ~/foo/bar/id_rsa user@remote-machine
will open ssh, ask for password, copy the ~/foo/bar/id_rsa.pub file into ~/.ssh/authorized_keys on the remote.
Otherwise
$ ssh-copy-id user@remote-machine
will copy whatever keys it finds to the remote (might be multiple!)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I would propose mentioning
ssh-copy-id
over manually editing~/.ssh/authorized_keys
.ssh-copy-id
takes the same-i
argument, so if you use a non-standard location for your key, lets say~/foo/bar/id_rsa
and~/foo/bar/id_rsa.pub
, thenwill open ssh, ask for password, copy the
~/foo/bar/id_rsa.pub
file into~/.ssh/authorized_keys
on the remote.Otherwise
will copy whatever keys it finds to the remote (might be multiple!)