linux下ftp管控,proftpd使用
linux下ftp管控proftpd使用
1、安装:源码地址:http://www.proftpd.org/
下载完毕后编译安装:
tar -zxvf proftpd-1.3.8.tar.gz
cd proftpd-1.3.8./configure --enable-nls --prefix=/usr/local/proftpd #(其中nls是mod_lang,文档:http://www.proftpd.org/docs/modules/mod_lang.html )
make
make install
编译安装完成后会在/usr/local/proftpd的目录下会生成配置文件目录以及相应服务的二进制可执行文件
2、配置:
cd /usr/local/proftpd
先进入到usr/local/proftpd/passwd
添加虚拟Ftp账户
./ftpasswd --passwd --name=ftpxiyang --uid=201 --gid=201 --home=/home/ftp --shell=/sbin/nologin --file=/usr/local/proftpd/etc/passwd
修改刚创建的ftp账户家目录
chmod 777 /home/ftp
修改配置文件
vim /usr/local/proftpd/etc
-r--r----- 1 root root 78 8月 18 14:22 passwd
-rw-r--r-- 1 root root 2186 8月 18 14:32 proftpd.conf
-rw-r--r-- 1 root root 2172 8月 18 14:26 proftpd.conf~
[root@train etc]# pwd
/usr/local/proftpd/etc
[root@train etc]# vim proftpd.conf24 # that allows you to limit maximum number of processes per service25 # (such as xinetd).26 MaxInstances 302728 # Set the user and group under which the server will run.29 User nobody30 Group nobody3132 # To cause every FTP user to be "jailed" (chrooted) into their home33 # directory, uncomment this line.34 #DefaultRoot ~3536 # Normally, we want files to be overwriteable.37 AllowOverwrite on3839 # Bar use of SITE CHMOD by default40 <Limit SITE_CHMOD>41 DenyAll42 </Limit>4344 # A basic anonymous configuration, no upload directories. If you do not45 # want anonymous users, simply delete this entire section. 46 <Anonymous ~ftp>47 User ftp48 Group ftp4950 # We want clients to be able to login with "anonymous" as well as "ftp"51 UserAlias anonymous ftp5253 # Limit the maximum number of anonymous logins54 MaxClients 105556 # We want 'welcome.msg' displayed at login, and '.message' displayed57 # in each newly chdired directory.58 DisplayLogin welcome.msg59 DisplayChdir .message6061 # Limit WRITE everywhere in the anonymous chroot62 <Limit WRITE>63 DenyAll64 </Limit>65 </Anonymous>66 RequireValidShell off67 AuthUserFile /usr/local/proftpd/etc/passwd6869 <Limit LOGIN>70 AllowUser ftpxiyang71 DenyALL72 </Limit>7374 <Directory "/home/ftp">75 <Limit RMD DELE RETR RNTO> #不允许重命名;删除文件、文件夹;下载76 DenyUser ftpxiyang77 </Limit>78 </Directory>79
cd /usr/local/proftpd
./sbin/proftpd
没有报错,说明开启成功,此时可以使用命令:
lsof -i :21 #FTP端口号
lsof -p (pid)##根据pid查找出进程树。
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
