作者:黯嘫吢碎1984rv | 来源:互联网 | 2014-05-28 09:12
1.安装服务apt-getinstallproftpd2.添加用户a.在/etc/passwd文件最后加入nizhua:x:1005:1::/var/www/nizhua:/bin/nologin#用户名用nizhua所属组daemonFTP目录/var/www/nizhua不允许登陆b.同步/etc/passwd和/
1.安装服务
apt-get install proftpd
2.添加用户
a.在/etc/passwd文件最后加入
nizhua:x:1005:1::/var/www/nizhua:/bin/nologin
#用户名用nizhua所属组daemon FTP目录/var/www/nizhua 不允许登陆
b.同步/etc/passwd和/etc/shadow文件
pwconv
c.设置密码
passwd nizhua
3.编辑/etc/proftpd/proftpd.conf在最后面加上
Include
/etc/proftpd/modules.conf
UseIPv6
off
ServerIdent off
"php126"
ServerName
"Debian"
ServerType
standalone
DeferWelcome
off
MultilineRFC2228
on
DefaultServer
on
ShowSymlinks
on
TimeoutNoTransfer
600
TimeoutStalled
600
TimeoutIdle
1200
DisplayLogin
welcome.msg
DisplayFirstChdir
.message
ListOptions
"-l"
DenyFilter
\*.*/
Port
21
PassivePorts
49152 65534
MaxInstances
30
User
proftpd
Group
nogroup
Umask
022 022
TransferLog /var/log/proftpd/xferlog
SystemLog /var/log/proftpd/proftpd.log
TLSEngine off
QuotaEngine on
Ratios on
DelayEngine on
ControlsEngine on
ControlsMaxClients 2
ControlsLog
/var/log/proftpd/controls.log
ControlsInterval 5
ControlsSocket
/var/run/proftpd/proftpd.sock
AdminControlsEngine on
AllowOverwrite
on
AllowForeignAddress on
AnonRequirePassword
on
User nizhua
Group daemon
umask 000
MaxClients 50 "Sorry,
the maximum number of allowed users are already connected (%m)"
MaxClientsPerHost 1
"Sorry, you may not connect more than one time."
RequireValidShell
off
AllowRetrieveRestart
on
AllowStoreRestart on
AllowALL
AllowOverwrite on
4.ServerType用standalone方式启动有错,不知道怎么改,用inetd方式正常启动
解决方法:UseIPv6 选项设为 off
5.重新启动服务
/etc/init.d/proftpd
stop
/etc/init.d/proftpd start
6.错误:Failed binding to 0.0.0.0, port 21: Address already
in use
原来用inetd 方式安装的,改为了standalone方式,启动时端口被占用了,启动服务失败。
解决方法是注释/etc/inetd.conf里面的inetd模式启动命令,如:
#ftp stream tcp
nowait root /usr/sbin/tcpd
/usr/sbin/proftpd