先建立ftp和media用户,用户组为nogroup,不允许登录系统
useradd media -d/home/media -gnogroup
增加权限
chown -R media /hoem/media
要使ftp用户登录要修改/etc/ftpuser文件注释掉ftp
内网架设FTP服务器的方法:
1. 在proftpd.conf中利用MasqueradeAddress命令将网关的IP地址或域名指定给FTP服务器,例如
MasqueradeAddress myftpserver.vicp.net ?????
或MasqueradeAddress 12.34.56.78 ?????经使用只能连接不能下载
然后通过PassivePorts命令来限制被动方式下监听的端口的范围,例如
PassivePorts 60000 65534
2. 在网关的端口映射上将第一步中指定的端口范围(例中为60000-65534)以及FTP端口21映射到FTP服务器的内网地址上。
getaddrinfo 'test' error: Name or service not known
- warning: unable to determine IP address of 'test'
- error: no valid servers configured
- Fatal: error processing configuration file '/etc/proftpd.conf'
解决:产生该问题是由于hosts文件里机器名未增加别名引起的。
#vi /etc/host
proftpd登陆速度慢的问题的解决
proftpd.conf中增加两行设置:
UseReverseDNS off
IdentLookups off
# This is a basic ProFTPD configuration file.
# It establishes a single server and a single anonymous login.
# It assumes that you have a user/group "nobody" and "ftp"
# for normal/anonymous operation.
ServerName "ProFTPD Default Installation"
ServerType standalone
#ServerType inetd
DefaultServer on
UseReverseDNS off
IdentLookups off
# Port 21 is the standard FTP port.
Port 21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022
# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances 30
# Set the user and group that the server normally runs at.
User ftp
# nobody
Group nogroup
# nogroup
# This next option is required for NIS or NIS+ to work properly:
#PersistentPasswd off
SystemLog /var/log/proftpd.log
TransferLog /var/log/xferlog
DefaultAddress 192.168.1.254
# Normally, we want files to be overwriteable.
<Directory /*>
AllowOverwrite on
</Directory>
<Anonymous ~media>
RequireValidShell off
User media
Group nogroup
MaxClients 50
DisplayLogin welcome.msg
DisplayFirstChdir .message
<Directory /*>
<Limit All>
AllowAll
</Limit>
</Directory>
</Anonymous>
# A basic anonymous FTP server configuration.
# To enable this, remove the user ftp from /etc/ftpusers.
<Anonymous ~ftp>
RequireValidShell off
User ftp
Group nogroup
# We want clients to be able to login with "anonymous" as well as "ftp"
# UserAlias anonymous ftp
# Limit the maximum number of anonymous logins
MaxClients 50
# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
DisplayLogin welcome.msg
DisplayFirstChdir .message
# An upload directory that allows storing files but not retrieving
# or creating directories.
<Directory /*>
<Limit READ>
AllowAll
</Limit>
# Limit WRITE everywhere in the anonymous chroot
<Limit WRITE>
AllowAll
</Limit>
<Limit STOR>
AllowAll
</Limit>
</Directory>
</Anonymous>