Rsync Permission denied (publickey).

Hi i'm following the tutorial below

https://www.linode.com/docs/tools-refer … n-to-rsync">https://www.linode.com/docs/tools-reference/tools/introduction-to-rsync

I already do ssh-keygen by following this tutorial https://www.linode.com/docs/security/se … ur-server/">https://www.linode.com/docs/security/securing-your-server/

so i skipped that part in rsync tutorial page and i'm able to do this in my local machine:

scp ~/.ssh/idrsa.pub user@hostname.com:/home/user/.ssh/uploadedkey.pub

But this line:

ssh user@hostname.com "echo 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).

How many machines are you working with here? Your local one and one server? Two?

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

Opening a ticket for this shouldn't get ignored, you should still try that imo. As for this, are you having issues using your public key normally to authenticate?

Hello, thanks to you all i'm able to resolve this. It was a permission problem because I can rsync in my /home/user directory without any problem.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct