美文网首页Tech
How to setup FTP server on ubunt

How to setup FTP server on ubunt

作者: qujian | 来源:发表于2015-12-05 15:43 被阅读31次

Step 1 » Update repositories .

$ sudo apt-get update 

Step 2 » Install VsFTPD package using the below command.

$ 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 

» Uncomment the below line (line no: 120 ) to prevent access to the other folders outside the Home directory.

chroot_local_user=YES 

and add the following line at the end.

allow_writeable_chroot=YES

» Add the following lines to enable passive mode.

pasv_enable=Yes
pasv_min_port=40000
pasv_max_port=40100

Step 4 » Restart vsftpd service using the below command.

krizna@leela:~$ 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 john -g www-data -s /usr/sbin/nologin
$ sudo passwd john

Step 6 » Allow write in directory. (add by me)

$ sudo chmod g+w -R .

Step 7 » Allow login access for nologin shell . Open /etc/shells and add the following line at the end.

/usr/sbin/nologin

Reference

相关文章

网友评论

    本文标题:How to setup FTP server on ubunt

    本文链接:https://www.haomeiwen.com/subject/vknshttx.html