Aliyun搭建ftp服务器

操作系统版本:[email protected]

1.安装vsftpd

设置更新源 vi /etc/apt/sources.list

deb http://mirrors.163.com/debian lenny main non-free contrib 
deb http://mirrors.163.com/debian lenny-proposed-updates main contrib non-free 
deb http://mirrors.163.com/debian-security lenny/updates main contrib non-free 
deb-src http://mirrors.163.com/debian lenny main non-free contrib 
deb-src http://mirrors.163.com/debian lenny-proposed-updates main contrib non-free 
deb-src http://mirrors.163.com/debian-security lenny/updates main contrib non-free 

安装

apt-get update 
apt-get inistall vsftpd 

2.配置 vsftpd

创建ftp登录用户

useradd -d /home/test -m test

设置主目录只读访问权限

chmod a-w /home/test

新建目录,并设置读写权限

mkdir /home/test/public && chmod 777 -R /home/test/public

设置密码

passwd test

用户只能使用ftp方式登录

 usermod -s /sbin/nologin test

配置vsftpd.conf
限制用户只能对主目录访问

chroot_local_user=YES

允许文件上传

write_enable=YES 
allow_writeable_chroot=YES

重启服务

service vsftpd restart

3.配置安全组

Aliyun搭建ftp服务器

参考:
Linux实例搭建FTP站点