0

I tried uploading files to server from my laptop through rsync command: rsync -avP --stats local/path/ user@host:remote/path. But I got permission denied errors because of not having permission to write. Cyberduck logged in & gave me the same error. At server side, root is disabled, with another user with sudo enabled.

When I was experimenting with rsync this worked perfectly, but left few files unsynced because of permission issues: rsync -avP --stats user@host:remote/path local/path

Also when I tried rsync from server end [learnt from stackoverflow]: rsync -avP --stats remote/path localuser@localhost:local/path, I failed because of not getting localuser & localhost correctly. I tried my ip address, hostname used by my ip address, my laptop's ip address & my laptop user's name. None of them worked.

How can I get results from either end without enabling root user at server end.

Community
  • 1
  • 1
lawsome
  • 165
  • 2
  • 8
  • Do you use a PEM key to connect to the server? For example when you ssh into it. Also is the remote path owned by the user you're rsync'ing as? – sage88 May 30 '16 at 00:08
  • i've added a ssh-rsa key with passphrase not PEM key, I ssh my vps `ssh remote user@remoteserver` from my laptop , I only enter passphrase. In the latter part of the question, I've first ssh into the server & then went for `rsync -avP --stats remote/path localuser@localhost:local/path`. – lawsome May 30 '16 at 04:29
  • Do you need to rsync to a server, or from a server (or both?)? You've mentioned both above, and they're probably separate problems. – sage88 May 30 '16 at 05:12
  • i think both problems requires sudo @ server but I need to upload files for my site , I need a rsync to server. – lawsome May 30 '16 at 05:28
  • rsync does not require the use of sudo. The user you are rsyncing as needs to be the owner of the remote/path. For each of the directories where you're trying to rsync to, ssh into the server and run `ls -la` to see what the permissions are. If the path doesn't belong to the user you rsync as, you won't be able to rsync. – sage88 May 30 '16 at 16:49
  • Hi @sage88 , i found this [link] (http://unix.stackexchange.com/questions/92123/rsync-all-files-of-remote-machine-over-ssh-without-root-user) , i need some time to learn & try this, i'll post back after some time. As you suggested, i checked the permissions, serverpilot has the permissions except one folder which I created as sudo , this is my destination folder. – lawsome May 30 '16 at 17:43
  • Looks like you're just going to use the server's root account to do your rsync. Sounds reasonable. The reason your rsync was failing was because your user didn't own the destination folder, but root will. – sage88 May 30 '16 at 18:21

0 Answers0