Tuesday, January 6, 2009

How to setup FTP access quickly and lazily in ubuntu

All I really need to do is just share my media drive out to the rest of the network. No fancy user permissions, or any other wizardry.

First off we need to install the software that will let us host an FTP server. vsftpd will work if you don't really care for a lot of features.

1.Type this in the terminal to install vsftpd:
sudo apt-get install vsftpd

2.Then your going to want to edit /etc/vsftpd.conf so that we can login to actual user names to access their home directories. To do so just type these lines into the terminal:
cd /etc
sudo nano vsftpd.conf

3.Once you are in the config file you will want to change the following settings:
anonomous_enable=YES to NO
#local_enable=YES to local_enable=YES

If you want to allow users to write to your ftp change this line:
#write_enable=YES to write_enable=YES

4.Now secure all user accounts! Make sure the root account is either disabled or it has a diffrent password that whatever account your using for your ftp. As always use diffrent passwords for diffrent accounts! The setting local_enable will make all acount's home dirs accessible via ftp (Protected by the same password of course.)

5.Now that you have everything locked down and setup, you may want to share stuff besides your home dir. I wanted to share an NTFS volume, (/media/Storage1) So I had to create another user account for this.

Go to System>Administration>Users and Groups. Click the Unlock button and enter in your password. (You will have to be an admin to do this step.)
Once you unlocked it you can now create a user. Make a simple user name and choose a password that is different than all your other passwords. Go to the User Privileges tab and uncheck everything that isn't needed for the account to share the folder/drive. (I kept "Mount user-space filesystems (FUSE)" on so I could share out my NTFS drive.) Hit OK and don't close out the Users Settings window.

6.Now we will need to point the account to the folder/drive we want to share. Ubuntu does not like to assign new accounts to a home directory that already exists so that is why you have to reopen the account properties. Now click on the account and click on the properties buton if you haven't already. This time go to the Advanced tab and set the home directory to the directory you want to share. (/media/Storage1NTFS/ for me.)

7.You may need to restart to get everything to work right. Now you have a fully functioning FTP server and it's a lot more easier to setup then to muck around with config files. :P

No comments:

Post a Comment