Building FTP server in linux

Recently I try to connect my PHPstorm to my virtual server. And I figure out that PHPstorm has a Deploying function. It allow user to deploy committed changes to a remote server.
Here is a link of Deploying configuration:
http://blog.jetbrains.com/phpstorm/2013/10/deploying-committed-changes-to-a-remote-server/


It seems that I have to use ftp to upload my files to the server.
Here is some simple steps to setup the ftp server in linux

Step1
Typing in the followed command:

sudo apt-get install vsftpd

Step2

Open the FTP server configuration file.

cd /etc/
vim vsftpd.conf

In the vsftpd.conf , we need to change several things.
eg:

 anonymous_enable=YES
 write_enable=YES
local_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES

NOTICE:we must set local_enable=YES,otherwise the ftp server will only allow anonymous visiting.


Step3

Create FTP user on server

eg:

useradd -m -G ftp -s /sbin/nologin -d /home/user newuser
passwd newuser


NOTICE:-s /sbin/nologin will not allow new user to login the server,

                -d /home/newuser will set default path for newuser

For existing user you should do:

usermod newuser -G ftp -d /home/newuser

Then remember to restart server:

service vsftpd restart 
or
sudo /etc/init.d/vsftpd restart



If you want to use ftp on another PC,typing in : ftp 172.168.2.123





Leave a Reply

Your email address will not be published. Required fields are marked *