3
I have an SSH server with key only auth and I want to add a key for a new user.
I log in with one user(kidmose), I try to append the key to a new user's(remote) authorized_keys and it fails:
kidmose@hech-remote-control:~$ sudo cat .ssh/id_rsa.pub > /home/remote/.ssh/authorized_keys
-bash: /home/remote/.ssh/authorized_keys: Permission denied
I sudo su
first and things work:
kidmose@hech-remote-control:~$ sudo su
[sudo] password for kidmose:
root@hech-remote-control:/home/kidmose# cat .ssh/id_rsa.pub > /home/remote/.ssh/authorized_keys
Bonus info:
kidmose@hech-remote-control:~$ ll /home/remote/.ssh/authorized_keys
-rw-r--r-- 1 remote remote 409 Oct 16 07:14 /home/remote/.ssh/authorized_keys
kidmose@hech-remote-control:~$ uname -a
Linux hech-remote-control.egki 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
So what is the (relevant) difference between the two approaches?