I want to transfer a file to a server, but when I use the command
scp -r /home/localName/course-account.log name@ip:/Users/name/java/
then I get the error
name@ip: Permission denied (publickey) lost connection
Do I need to edit the id_rsa
or id_rsa.pub
?
I can log in at the server, but I cannot upload a file!
I have saved the remote Public Key to the local name "key" and I set iTerm2 to log in automatically, using the config to find the "key".
I have already added the remote key to the id_rsa
and id_rsa.pub
, but it does not work.
scp -r /home/localName/course-account.log name@ip:/Users/name/java/
If you want to login via ssh and your key, your public key must be present on the server in a specific file.
id_rsa.pub
)~/.ssh/authorized_keys
on the server.