在由xinetd控制的proftpd(plesk / centos FWIW)的服务器上,我想让proftpd仅侦听特定的ip地址。
我试过把bind = 12.34.56.78放在/etc/xinetd.d/ftp_psa ,并且把DefaultAddress 12.34.56.78放在/etc/proftpd.conf ,但是看起来不行。
重新启动xinetd后,nmap显示端口21仍然在我的其他公共IP上被监听。
谁能告诉我我做错了什么?
就像一个testing,我在xinetdconfiguration文件中注释了整个ftp服务,并且确实禁用了服务,所以我显然是在正确的位置,但bind选项似乎不起作用。
提前致谢
更新 :configuration文件(munis评论为简洁)
/etc/xinetd.d/ftp_psa
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY, #SO ALL YOUR CHANGES WILL BE LOST AFTER YOU UPGRADE PARALLELS PLESK PANEL. service ftp { flags = IPv6 disable = no socket_type = stream protocol = tcp wait = no user = root instances = UNLIMITED server = /usr/sbin/in.proftpd server_args = -c /etc/proftpd.conf bind = 12.34.56.78 }
我知道这里说不要修改,但我没有做一个plesk升级,我也尝试把绑定在默认部分(没有这样的警告):
/etc/xinetd.conf中
defaults { log_type = SYSLOG daemon info log_on_failure = HOST log_on_success = PID HOST DURATION EXIT cps = 50 10 instances = 50 per_source = 10 v6only = no groups = yes umask = 002 bind = 12.34.56.78 } includedir /etc/xinetd.d
为了完整:/etc/proftpd.conf
ServerIdent off ServerName "ProFTPD" ServerType inetd DefaultServer on <Global> DefaultRoot ~ psacln AllowOverwrite on </Global> DefaultTransferMode binary UseFtpUsers on TimesGMT off SetEnv TZ :/etc/localtime Port 21 DefaultAddress 12.34.56.78 SocketBindTight on Umask 022 MaxInstances 30 ScoreboardFile /var/run/proftpd/scoreboard TransferLog /usr/local/psa/var/log/xferlog <Directory /var/www/vhosts> GroupOwner psacln </Directory> AuthPAM on AuthPAMConfig proftpd IdentLookups off UseReverseDNS off AuthGroupFile /etc/group
你使用的是什么版本的CentOS? 我只是尝试CentOS 6.3。 xinetd文件被称为/etc/xinetd.d/xproftpd ,需要在文件中设置disable=no来启用,并且说chkconfig proftpd on 。 我只需要设置bind = 10.0.2.15让proftpd只监听这个地址。 无需进一步调整proftpd.conf 。
将bind更改为不同的值后,我无法再连接到任何其他IP地址。 甚至不是localhost 。
/etc/xinetd.d/xproftpd:
# default: off # description: The ProFTPD FTP server serves FTP connections. It uses \ # normal, unencrypted usernames and passwords for authentication. service ftp { socket_type = stream wait = no user = root server = /usr/sbin/in.proftpd log_on_success += DURATION USERID log_on_failure += USERID nice = 10 disable = no bind = 10.0.2.15 }
chkconfig的:
# chkconfig --list proftpd proftpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
/etc/proftpd.conf仍然处于默认状态,除了设置ServerType inetd以使其与xinetd配合使用。