Rsync Permission denied (publickey).
I already do ssh-keygen by following this tutorial
so i skipped that part in rsync tutorial page and i'm able to do this in my local machine:
scp ~/.ssh/idrsa.pub
But this line:
ssh cat ~/.ssh/uploaded_key.pub
>> ~/.ssh/authorized_keys"
gives me error:
ssh username@XXXX "echo cat ~/.ssh/uploaded_key.pub
>> ~/.ssh/authorized_keys"
cat: /Users/xxx/.ssh/uploaded_key.pub: No such file or directory
Permission denied (publickey).
what does it mean? I try to ignore it and do rsync command:
rsync -a ssh [source] user@XXXX:/var/www/sandbox/test_rsync
It gives me a Permission denied (13) error.
I just hope that his forum is still alive and give me tips because opening a ticket for this will probably get ignored.
4 Replies
> ssh username@XXXX "echo
cat ~/.ssh/uploaded_key.pub
>> ~/.ssh/authorized_keys"
cat: /Users/xxx/.ssh/uploaded_key.pub: No such file or directory
/Users/xxx/.ssh/uploaded_key.pub isn't found on the remote system. Try specifiying the full path to the file:
> ssh username@XXXX "echo
cat /home/user/.ssh/uploaded_key.pub
>> ~/.ssh/authorized_keys"
The error is due I think to the tilde (~) being interpreted as your home directory on the local machine (/Users/xxx) rather than your home directory on the remote machine (/home/user).
Which user are you remotely connecting to? What is the ownership of the directory? You can find out that last part by running the following commands:
ls -la /var/www/sandbox/
ls -la /var/www/sandbox/test_rsync