• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 346
  • Last Modified:

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?

Cheers
0
thechase22
Asked:
thechase22
3 Solutions
 
BlazCommented:
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.
0
 
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?
0
 
BlazCommented:
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...
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
thechase22Author Commented:
Can I just ask, how do you do linux backup? what software do you use? or solution?
0
 
arrkerr1024Commented:
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
0
 
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

Cheers
0
 
BlazCommented:
Regarding the tar backup of the system I found some links describing the method:
http://www.gnu.org/software/tar/
http://www.ibm.com/developerworks/linux/library/l-roadmap8/
http://www.faqs.org/docs/linux_admin/x2540.html
http://linux.cudeso.be/linuxdoc/backuprestore.php

As far as configuring different dirs for vsftpd - each user should have a different root dir. Configuration file manual:
http://vsftpd.beasts.org/vsftpd_conf.html

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
0
 
ilkerduranCommented:
Hi, You can use symbolic links in your directory and let FTP User follow these links.
Regards,
ilker
0
 
thechase22Author Commented:
Hey guys thanks for your great replys, let me take a look and get back to you
0
 
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.
0
 
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.

Curt

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,.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now