Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Advertise on LowEndTalk.com
Setup&Configuring vsftpd
New on LowEndTalk? Please read our 'Community Rules' by clicking on it in the right menu!

Setup&Configuring vsftpd

Hello,
So i want to use my vps as download server for a filesharing script. Thus i tried setting up vsftpd on my vultr storeage vps following the tutorial below. I need the vsftpd to allow remote access, too. Is this included in this setup already?
If not what do i have to change?
In my filesharing script i need to enter ftp username, pw and port so i need to activate ftp on the dl vps somehow.

Step 1 » Update repositories .

sudo apt-get update
1
sudo apt-get update
Step 2 » Install VsFTPD package using the below command.

sudo apt-get install vsftpd
1
sudo apt-get install vsftpd
Step 3 » After installation open /etc/vsftpd.conf file and make changes as follows.
Uncomment the below lines (line no:29 and 33).

write_enable=YES
local_umask=022
1
2
write_enable=YES
local_umask=022
Uncomment the below line (line no: 120 ) to prevent access to the other folders outside the Home directory.

chroot_local_user=YES
1
chroot_local_user=YES
and add the following line at the end.

allow_writeable_chroot=YES
1
allow_writeable_chroot=YES
Add the following lines to enable passive mode.

pasv_enable=Yes
pasv_max_port=40000
pasv_min_port=40100
1
2
3
pasv_enable=Yes
pasv_max_port=40000
pasv_min_port=40100
Step 4 » Restart vsftpd service using the below command.

sudo service vsftpd restart
1
sudo service vsftpd restart
Step 5 » Now ftp server will listen on port 21. Create user with the below command.Use /usr/sbin/nologin shell to prevent access to the bash shell for the ftp users .

sudo useradd -m john -s /usr/sbin/nologin
sudo passwd john
1
2
sudo useradd -m john -s /usr/sbin/nologin
sudo passwd john
Step 6 » Allow login access for nologin shell . Open /etc/shells and add the following line at the end.

/usr/sbin/nologin
1
/usr/sbin/nologin
Now try to connect this ftp server with the username on port 21 using winscp or filezilla client and make sure that user cannot access the other folders outside the home directory.

Thanked by 1rokok

Comments

  • NickMNXioNickMNXio Member, Provider

    If you followed these steps, you should have vsftp running. However, you may need to adjust your firewall rules if you had any in place to open up inbound FTP connections.

    To test if the vsftp service is running properly, you can run from the command line:

    telnet 21

    If you receive a connection showing a vsftp banner -- then at least the service is running, and you can continue your debugging with that in mind.

    https://mnx.io - 100% SSD Cloud Hosting - $10/month - FreeBSD - SmartOS - Linux

  • @NickMNXio said:
    If you followed these steps, you should have vsftp running. However, you may need to adjust your firewall rules if you had any in place to open up inbound FTP connections.

    To test if the vsftp service is running properly, you can run from the command line:

    telnet 21

    If you receive a connection showing a vsftp banner -- then at least the service is running, and you can continue your debugging with that in mind.

    Thanks for the reply, I have now tried another approach though which has worked just fine.
    For anyone interested here the commands for debian 7:

    apt-get update
    apt-get install sudo
    apt-get install proftpd
    sudo adduser Test
    passwd Test
    enter password
    sudo service proftpd restart
    Now you can use Test to connect via FTP to your Server :)

Sign In or Register to comment.