Month: July 2012

Creating a FTP user , adding ftp user to your Linux

Before adding FTP user you have to install FTP server

Install the FTP server

To install the FTP server, type:
sudo aptitude install vsftpd

Configure FTP server

The FTP server configuration is done by editing the file / etc / vsftpd.conf
To edit this file, do:
gksu gedit /etc/vsftpd.conf

Prohibit anonymous FTP

Change the line:
anonymous_enable=YES
in:
anonymous_enable=NO

Comment out the chroot_list_enable=YES line as well.

Allow local users to connect

Add:
local_enable=YES

This will allow users reported in Ubuntu use the same login/password to access the FTP server.
Allow users to upload files

Add:
write_enable=YES

Select Interface

By default the FTP server will listen on all interfaces. If you want to restrict it only to your local network(10.0.0.x) add the line:
listen_address=10.0.0.1
Given that the LAN IP address of your FTP server is 10.0.0.1

Start FTP server

(Re)start the FTP server so that it takes into account the configuration we just changed.
Type:
sudo /etc/init.d/vsftpd restart

Until now only FTP server is installed

#edit /etc/vsftpd.conf or /opt/etc/vsftpd.conf
Open the vsftpd.conf file and search for chroot_list_enable=YES
Make sure it is YES. Do the same for the following variables
chroot_list_file=/etc/vsftpd.chroot_list or /opt/etc/vsftpd.chroot_list
chroot_list_enable=YES
Save and close the file

Create vsftpd.chroot_list in /etc/ or /opt/etc/
Add the username you want to export to ftp.
IMP: The user must already be a system user with a valid passwd. You must be able to find /home/
If the user you want to add is not a system user then create that user first before editing the above file.
#adduser
#passwd

Restart the vsftpd server using /etc/init.d/vsftpd restart or service vsftpd restart
Now you can log into ftp using the new user.

Advertisements