VSFTP making a ftp account to backup the server

Hey Guys

Ive got vsftpd setup on my server, and it restricts the user to its home directory, I was wondering how I could have an ftp user download the whole entire system, for example start from /

But the users restricted to the root is /home/vsftpusers.

I cant quite get around the solution or think of a way I can do it, and I dont think its a good idea to use root to perform the task

Any suggestions?

Who is Participating?
You can't reliably back up a system with FTP because it won't preserve links - it will copy each file every time instead.

Creating a tarball of the system and then ftp-ing it would work...  you'd want to exclude special files like /dev and /proc.

Another really good option would be to use rsync.  If you have another unix system rsync will sync two directories.  So you could rsync / on the system you want to back up to /backups/servername on your other system and it will be preserved complete with permissions.  And best yet, you can run rsync again and it will just get the changes, so you could run it on a regular basis to get backups.
rsync can either use an rsync server on the server site, or most commonly (and more securely, but slower) can just use ssh.

From the machine you want to back up TO:
rysnc -az root@source:/ /localdirectorytostorebackup
Using a ftp account that can access all your system is a bad idea.

If you must use ftp for your backup it would be better to have a job on the server that would create a .tgz file containing the whole system and then ftp-ing only that file. The file can reside in /home/vsftpusers and all your problems solved.

Transfering data with scp would be a better idea than ftp.
thechase22Author Commented:
Isnt that part of ssh? I think I read something like that before.

My dedicated server is currently on fedora core 5, 64 bit, ive had so many problems trying to install drivers and programs, my sites are about to go live on this server.

So im  thinkign well all the hard work ive done on the server so far, ill save it and migrate it, but put it back to fedora core 5 32 bit.

You know one of them jobs you just have to do or you wont be happy untill its fixed.

Any other ideas then now u know my situation?
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

For your exact situation I have no solution out of my head. But again - if you backup all your data to a tgz file you can then copy it with your current ftp setup and restore it later on the new machine. Tgz only puts everything in a single file and compresses it. You still have access to all the files and all, so...
thechase22Author Commented:
Can I just ask, how do you do linux backup? what software do you use? or solution?
thechase22Author Commented:
Ok ill take in what you said

One other question, is it possible to somehow have 2 local roots for the ftp.

heres the situation, I have my ftp local root as /var/ww/html/ as you guessed they are ftp accounts for uploading webpages, that I restrict these users.

But sometimes I find it hard to transfer files from windows to linux, so what I do is use a ftp account that uploads straight into /var/ftp/pub/

So is there a way this can be done? 2 different types of users, tell me any ideas you have on your mind

Regarding the tar backup of the system I found some links describing the method:

As far as configuring different dirs for vsftpd - each user should have a different root dir. Configuration file manual:

You should have passwd_chroot_enable=yes and then edit the lines in /etc/passwd file to configure the root for individual user. The root for ftp is where a dot is in the path  
ftpuser:x:500:500:FTP WWW User:/home/ftpuser/./ftp/:/bin/ftponly
Hi, You can use symbolic links in your directory and let FTP User follow these links.
thechase22Author Commented:
Hey guys thanks for your great replys, let me take a look and get back to you
thechase22Author Commented:
Hi again

So im trying to use rsync to get the remote files, to this local, is that possible?

The article im reading is trying to put the local to the remote, quite the opposite of what I need.
thechase22Author Commented:
Hey guys.

I managed to sort it out in the end, I noticed that I could use cute ftp, and login via SSH and transfer the files over.

My dedicated webserver was fedora core 6 x64 version, I had been having so many issues with x64 concerning drivers and couldnt do various things.

I also had plesk installed that I was manually removing.

So I wanted to go back to a clean Fedora 6 32 bit version.

So thanks for your help and ill distribute the points accordingly.


I successfully just did it, reimaged the server, I moved all the databases and websites back it worked a treat.

Rsync was helpful, not for this stage, but for other ideas I have,.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.