I'm going to perform some maintenance on my VPS (Ubuntu Server 15.04), and I would like to back up some files before doing so. The problem is that some of these files are under other users' home directories or otherwise locked-down places, so I cannot access them normally via SFTP. I considered using a local SSH server to transfer files to my computer (Windows 8.1 x64), but I'm behind a university network and can't forward a port to my computer as would be required to do that.

What is a secure way to get these files to my computer? It's my server, so I obviously have root access, but I don't want to change permissions on things unless I have to.

  • I don't really understand how you can not access files if you have root account? When you log into your VM just do sudo -i and then you can copy files to wherever you want. If you don't have access to another remote SSH server just make a tar.gz and place it somewhere reachable. – mbiber May 2 '15 at 1:16
  • @mbiber Yeah, that makes a lot of sense. This question actually somewhat evolved into this one, so I think I'm going to repost that one. Your answer actually does answer my question though--just doing tar -cvpzf ~/backup.tar.gz /path/to/directory (with sudo as necessary) would be exactly what I need. If you post that I'm more than happy to accept it as the answer. – vaindil May 2 '15 at 17:16
  • Is rsync an option? Is stackoverflow.com/questions/16654751/rsync-through-ssh-tunnel helpful? – Konstantinos May 8 '15 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.