メインメニュー

連続稼働時間

本サーバは
39日間と7時間18分
連続稼動しています

広告

トップ  >  CentOS・Fedora  >  FTP  >  vsftpdでFTPサーバ構築[fedora CentOS5.5]vsftpdでFTPサーバ構築[fedora CentOS5.5]
サーバにファイルの送受信ができるようにftpサーバを構築します。

はじめにサーバにファイアウォール(iptables)をインストールし、有効にしている場合は、そちらの設定もしくは停止をしてください。

はじめにvsftpdをインストールします。
#yum -y install vsftpd

次に設定ファイル /etc/vsftpd/vsftpd.conf を編集していきます。

# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO #YESをNOに変更(匿名ログインの禁止)

# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
xferlog_file=/var/log/vsftpd.log #vsftpd.logにログを保存

# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
xferlog_std_format=NO #NOにすることでvsftpd.logへ保存が有効になる

# 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
ascii_upload_enable=YES #asciiモードでアップロード許可
ascii_download_enable=YES #asciiモードでダウンロード許可

# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
ftpd_banner=Welcome to blah FTP service. #接続時にサーバのバージョンを非表示にする

# 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_list_enable=YES
chroot_list_enable=YES #ホームディレクトリより上位の階層にいけないようにする場合に設定(chroot)
chroot_local_user=YES #ホームディレクトリより上位の階層にいけないようにする場合に設定(chroot)
# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list
chroot_list_file=/etc/vsftpd/chroot_list #ホームディレクトリより上位の階層にいけないようにする場合に設定(chroot)
# 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
ls_recurse_enable=YES #フォルダごと削除を許可

#以下を最後に追加
local_root=public_html #chroot利用時は必須
use_localtime=YES #タイムスタンプをサーバと同じにする

tcp_wrappers=YES



次にホームディレクトリより上位の階層にいけるユーザーを /etc/vsftpd/chroot_list に記載する。登録しない場合はファイルだけ作成すること。
また、FTPはTCP WRAPERでアクセス制限をかけられているので /etc/hosts.allowに  vsftpd : 192.168. #IPアドレス192.168.*.*のみ許可を追記する。

最後にvsftpdを起動させるため、以下のコマンドを実行する。
#chkconfig vsftpd on
#service vsftpd start

これでNGと表示されなければ設定は完了です。
プリンタ用画面
投票数:177 平均点:5.82
カテゴリートップ
FTP
次
vsftpdで550 エラーが表示されファイルのダウンロードができない