Harden SSH Access?
$ scp ~/.ssh/linode_id_rsa.pub usr@xx.xx.xxx.xxx:/.ssh/authorized_keys
$ usr@xx.xx.xxx.xxx's password:
$ scp: /.ssh/authorized_keys: No such file or directory
How can I resolve this? I am unable to cd into the directory. Should I exit and attempt this as root?
4 Replies
$ scp ~/.ssh/linodeidrsa.pub usr@xx.xx.xxx.xxx:/.ssh/authorized_keys
Looks like you left out the ~ on the remote side, I think it should be
$ scp ~/.ssh/linodeidrsa.pub usr@xx.xx.xxx.xxx:~/.ssh/authorized_keys
````
@Stever:
$ scp ~/.ssh/linode_id_rsa.pub usr@xx.xx.xxx.xxx:/.ssh/authorized_keys
Looks like you left out the ~ on the remote side, I think it should be
$ scp ~/.ssh/linode_id_rsa.pub usr@xx.xx.xxx.xxx:~/.ssh/authorized_keys
Bah! My mistake. This worked. However, it tells me that Permission is Denied after entering my password. Would this be relevant to CHMOD?
And also, to copy the public key over .ssh/authorized_keys isn't the best method, unless you only ever want to allow access from just one single source. Normally you would _append_ to authorized_keys, like so:
cat ~/.ssh/idrsa.pub | ssh
(I wrote idrsa.pub there, I'm not sure why you have a file named linodeid_rsa.pub unless you really changed the default name of your local rsa key file(s))