[[vsftp]]

~
*待受ポートの変更 [#oa5ed5e8]
 # vi /etc/vsftpd/vsftpd.conf
 listen_port=50021    <--追加
~ 
~
iptablesも必要に応じて、上記ポートを空けてください。
ポートが空いているか確認するコマンドは下記のコマンドです。

 # netstat -lntp

~


*Passiveモードのポートを制限 [#h4f8ea90]
FTPで接続する際のランダムポートを限定します。~

 # vi /etc/vsftpd/vsftpd.conf
 pasv_min_port=20500
 pasv_max_port=20999
 
 ※iptablesでポート制限をしている場合は上記ポートの範囲帯を許可するように設定してください。
 例:
 # cd /etc/sysconfig
 # cp -p iptables iptables.`date +%Y%m%d`
 # vi iptables
 -A INPUT -m state --state NEW -m tcp -p tcp --dport 20500:20999 -j ACCEPT
 # service iptables restart
 # iptables -L
 ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpts:ftp-data:ftp
 ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpts:20500:athand-mmp

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS