| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

Fedora Core 6 FTP サーバの構築

提供: MyMemoWiki
ナビゲーションに移動 検索に移動

Fedora Core 6 FTP サーバの構築

Fedora Core 6 | CentOS 初期設定 |

インストール

パッケージの確認
  1. # rpm -q vsftpd
  2. パッケージ vsftpd はインストールされていません。
インストール
  1. [root@garuda ~]# yum install vsftpd
  2. Loading "installonlyn" plugin
  3. Setting up Install Process
  4. :

設定

  • /etc/vsftpd/vsftpd.conf
  1. # Allow anonymous FTP? (Beware - allowed by default if you comment this out).
  2. anonymous_enable=YES
  3. # Uncomment this to allow local users to log in.
  4. local_enable=YES
  5. :

anonymousログオンを無効化

  • 以下をコメントアウト
  1. #anonymous_enable=YES

ログ出力

  • 以下のコメントアウトをはずす
  1. xferlog_file=/var/log/vsftpd.log

ドメインやIPアドレスにもとづく制限を課す

  • ドメインやIPアドレスにもとづく制限を課す場合は、vsftpdではなく、tcp_wrapper側で行う。
TCP_WRAPPERの動作
  1. /etc/hosts.allow の設定に一致するクライアントに接続許可
  2. 上記以外で、/etc/hosts.denyの設定と一致するクライアントを拒否
  3. /etc/hosts.allowと/etc/hosts.denyの設定に一致しないクライアントは常に許可
vsftpd.conf
  1. tcp_wrappers=YES
/etc/hosts.allow
  1. # 192 で始まるアドレスを許可
  2. vsftpd : 192. : ALLOW
  3. # example.jp ドメインの接続を許可
  4. vsftpd : .example.jp : ALLOW
  5. # 上記以外すべて拒否
  6. vsftpd : ALL : DENY


[Fedora Core 6 ファイヤーウォールの設定 ファイヤーウォールの設定]

システム - 管理 - セキュリティレベルとファイアーウォールの設定 0455 ftp.png

root でログイン

<blockquote>非推奨だが、root でログインできる様にするためには、/etc/vsftpd/ftpusers、/etc/vsftpd/user_list の両方からroot 行をコメントアウトすることで可能</blockquote>

起動

システム起動時にサービスも起動する

確認

  1. # chkconfig --list vsftpd
  2. vsftpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off

現在のランレベルの場合、自動起動

  1. # runlevel
  2. N 5 <- ランレベルの確認
  3. # chkconfig vsftpd on
  4. # chkconfig --list vsftpd
  5. vsftpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

ランレベルを指定する

  1. # chkconfig --level 3 vsftpd on
  2. # chkconfig --list vsftpd
  3. vsftpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
サービスの実行
  1. # /etc/init.d/vsftpd status
  2. vsftpd は停止しています
  3. # /etc/init.d/vsftpd start
  4. vsftpd 用の vsftpd を起動中: [ OK ]
  5. # /etc/init.d/vsftpd stop
  6. vsftpd を停止中: [ OK ]
  7. #