I'm trying to setup ssh-copy-id on ubuntu I need a second opinion on this, is this a missing .pub path or wrong settings for ssh
sammy@samuel-pc:~$ cat ~/.ssh/id_rsa.pub
cat: /home/sammy/.ssh/id_rsa.pub: Permission denied
sammy@samuel-pc:~$ ssh-copy-id [email protected]
/usr/bin/ssh-copy-id: ERROR: failed to open ID file '/home/sammy/.pub': No such file
(to install the contents of '/home/sammy/.pub' anyway, look at the -f option)
sammy@samuel-pc:~$ cd .ssh
-bash: cd: .ssh: Permission denied
sammy@samuel-pc:~$ sudo ls -l ~/.ssh/id_rsa.pub
[sudo] password for sammy:
-rwxr-xr-x 1 sammy sammy 397 Jul 12 20:25 /home/sammy/.ssh/id_rsa.pub
I've also tried sshing from my computer, but the authentication was broken and I tried to fix it but it fails
samuel@samuel-pc:~$ ssh-copy-id [email protected]
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password:
sh: 1: cannot create .ssh/authorized_keys: Permission denied
Result from sudo ls -lsa ~/.ssh
sammy@samuel-pc:~$ sudo ls -lsa ~/.ssh
[sudo] password for sammy:
Sorry, try again.
[sudo] password for sammy:
total 28
4 drw-rw-rw- 2 sammy sammy 4096 Jul 13 21:25 .
4 drwxr-xr-x 9 sammy sammy 4096 Jul 19 23:55 ..
4 -rwxr-xr-x 1 sammy sammy 790 Jul 13 21:35 authorized_keys
4 -rwxr-xr-x 1 sammy sammy 1675 Jul 12 20:25 id_rsa
4 -rwxr-xr-x 1 sammy sammy 397 Jul 12 20:25 id_rsa.pub
4 -rwxr-xr-x 1 sammy sammy 1024 Jul 13 12:48 .id_rsa.pub.swp
4 -rwxr-xr-x 1 sammy sammy 222 Jul 12 20:21 known_hosts
and result for ls -ld ~/.ssh
sammy@samuel-pc:~$ ls -ld ~/.ssh
drw-rw-rw- 2 sammy sammy 4096 Jul 13 21:25 /home/sammy/.ssh
How can I get right access for ssh in the server?
ls -lsa ~/.ssh
~/.ssh
?sudo ls -lsa ~/.ssh
might be better. did you create your keys usingroot
user?ls -ld ~/.ssh
too please?