sh: .ssh/authorized_keys: Is a directory? - Ask Ubuntu


i'm trying copy /id_rsa.pub machine command

cat .ssh/id_rsa.pub | ssh root@10.0.2.15 'cat >> .ssh/authorized_keys' 

but keep getting error

sh: .ssh/authorized_keys: directory 

i created directory following commands

mkdir ~/.ssh chmod 700 ~/.ssh touch ~/.ssh/authorized_keys 

the output command on target machine

ls -l /root/.ssh 

is "total 0"

the problem you've made directory called ~/.ssh/authorized_keys. supposed file. i'm not sure how has happened, given commands you've listed should have made ~/.ssh directory , authorized_keys file within it.

remove authorized keys directory on remote machine, , replace file. or better, use ssh-copy-id command local machine create file , add key in 1 single command:

ssh-copy-id user@ip-address 

Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User