vsftpdのインストール

FTPサーバーの構築

サーバにファイルをアップロードするためのFTPサーバーを構築します。
ソフトウェアにはバージョン2.0.1 からSSL/TLSに対応しているvsftpdを利用します。
vsftpdという名称は、「Very Secure FTP daemon」の略で、その名のとおりセキュリティ重視の設計になっているようです。


vsftpdのインストール

[root@centos ~]   yum -y install vsftpd

vsftpdの基本的な設定

vsftpdの設定ファイルは /etc/vsftpd/vsftpd.conf です。
以下、主なディレクティブを編集します。
"ディレクティブ名=値"の形式で記載しますが、=の前後にスペースを入れて記載してはいけません。

[root@centos ~]   vi /etc/vsftpd/vsftpd.conf
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO    ※匿名(Anonymous)でのログインを禁止

# Uncomment this to allow local users to log in.
local_enable=YES   ※ローカルユーザーのログインを許可

# Uncomment this to enable any form of FTP write command.
write_enable=YES   ※ファイルシステムを変更するFTPコマンドを許可する(対象となるコマンド : STOR, DELE, RNFR, RNTO, MKD, RMD, APPE, SITE)

# Activate logging of uploads/downloads.
xferlog_enable=YES ※転送記録をログに残す

# You may override where the log file goes if you like. The default is shown
# below.
xferlog_file=/var/log/vsftpd.log   ※転送記録を記録するログファイルの指定

# If you want, you can have your log file in standard ftpd xferlog format
xferlog_std_format=YES ※ログのフォーマットは標準のものを利用

# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
ascii_upload_enable=YES    ※アスキーモードでのアップロードの許可
ascii_download_enable=YES  ※アスキーモードでのダウンロードの許可

# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
chroot_local_user=YES  ※デフォルトでホームディレクトリより上層へのアクセスを禁止
chroot_list_enable=YES ※ホームディレクトリより上層のディレクトリへのアクセスを許可するユーザーのリストを有効化
# (default follows)
chroot_list_file=/etc/vsftpd/chroot_list   ※ホームディレクトリより上層のディレクトリへのアクセスを許可するユーザーのリストを記載するファイルのパス

# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
ls_recurse_enable=YES  ※ディレクトリごと削除できるようにする

ホームディレクトリより上層のディレクトリへのアクセスを許可するユーザーを設定

[root@centos ~]#  echo user1 >> /etc/vsftpd/chroot_list   ※例としてusr1をホームディレクトリより上層のディレクトリへのアクセスを許可するユーザーに登録する場合

vsftpdの起動

[root@centos ~]#  /etc/rc.d/init.d/vsftpd start   ※vsftpdを起動
[root@centos ~]#  chkconfig vsftpd on ※OS起動時にvsftpdが起動するように設定

ルーターの20番ポートを開放する。


最終更新 2009-03-07

この記事へのコメント

まだコメントは投稿されていません。

カテゴリー

その他



スポンサードリンク