!!!Fedora Core 6 FTP サーバの構築 [Fedora Core 6][CentOS 初期設定] !!インストール ::パッケージの確認 # rpm -q vsftpd パッケージ vsftpd はインストールされていません。 ::インストール [root@garuda ~]# yum install vsftpd Loading "installonlyn" plugin Setting up Install Process : !!設定 */etc/vsftpd/vsftpd.conf # Allow anonymous FTP? (Beware - allowed by default if you comment this out). anonymous_enable=YES # Uncomment this to allow local users to log in. local_enable=YES : !anonymousログオンを無効化 *以下をコメントアウト #anonymous_enable=YES !ログ出力 *以下のコメントアウトをはずす xferlog_file=/var/log/vsftpd.log !ドメインやIPアドレスにもとづく制限を課す *ドメインやIPアドレスにもとづく制限を課す場合は、vsftpdではなく、tcp_wrapper側で行う。 ::TCP_WRAPPERの動作 +/etc/hosts.allow の設定に一致するクライアントに接続許可 +上記以外で、/etc/hosts.denyの設定と一致するクライアントを拒否 +/etc/hosts.allowと/etc/hosts.denyの設定に一致しないクライアントは常に許可 ::vsftpd.conf tcp_wrappers=YES ::/etc/hosts.allow # 192 で始まるアドレスを許可 vsftpd : 192. : ALLOW # example.jp ドメインの接続を許可 vsftpd : .example.jp : ALLOW # 上記以外すべて拒否 vsftpd : ALL : DENY ::[ファイヤーウォールの設定|Fedora Core 6 ファイヤーウォールの設定] システム - 管理 - セキュリティレベルとファイアーウォールの設定 {{ref_image ftp.png}} !root でログイン ""非推奨だが、root でログインできる様にするためには、/etc/vsftpd/ftpusers、/etc/vsftpd/user_list の両方からroot 行をコメントアウトすることで可能 !!起動 ::システム起動時にサービスも起動する 確認 # chkconfig --list vsftpd vsftpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off 現在のランレベルの場合、自動起動 # runlevel N 5 <- ランレベルの確認 # chkconfig vsftpd on # chkconfig --list vsftpd vsftpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off ランレベルを指定する # chkconfig --level 3 vsftpd on # chkconfig --list vsftpd vsftpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off ::サービスの実行 # /etc/init.d/vsftpd status vsftpd は停止しています # /etc/init.d/vsftpd start vsftpd 用の vsftpd を起動中: [ OK ] # /etc/init.d/vsftpd stop vsftpd を停止中: [ OK ] #