- 1. インストール
- 2. anonymous ユーザを有効にする
- 3. anonymous ユーザに権限を与える
1. インストール
こちらの記事は
「Ubuntu 14.04 LTS : FTPサーバー : Vsftpd インストール : Server World」
を参考にさせていただきました。
端末を開いて
> sudo apt-get install vsftpd
[sudo] password for hogehoge: ← パスワードを入力
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下のパッケージが新たにインストールされます:
vsftpd
アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 732 個。
111 kB のアーカイブを取得する必要があります。
この操作後に追加で 361 kB のディスク容量が消費されます。
取得:1 http://jp.archive.ubuntu.com/ubuntu/ trusty-updates/main vsftpd amd64 3.0.2-1ubuntu2.14.04.1 [111 kB]
111 kB を 3秒 で取得しました (33.6 kB/s)
パッケージを事前設定しています ...
以前に未選択のパッケージ vsftpd を選択しています。
(データベースを読み込んでいます ... 現在 167948 個のファイルとディレクトリがインストールされています。)
.../vsftpd_3.0.2-1ubuntu2.14.04.1_amd64.deb を展開する準備をしています ...
vsftpd (3.0.2-1ubuntu2.14.04.1) を展開しています...
man-db (2.6.7.1-1) のトリガを処理しています ...
ureadahead (0.100.0-16) のトリガを処理しています ...
vsftpd (3.0.2-1ubuntu2.14.04.1) を設定しています ...
vsftpd start/running, process 5005
ureadahead (0.100.0-16) のトリガを処理しています ...
2. anonymous ユーザを有効にする
デフォルトで anonymous ユーザは有効になっていません。
Windows からログインしてみます。ちなみに 172.20.10.3 は、LAN なので、公開しても問題ありませんことよ。
まぁ、だめなわけです。

> sudo vi /etc/vsftpd.conf
で /etc/vsftpd.conf を開いて
# Allow anonymous FTP? (Disabled by default)
anonymous_enable=NO
↑
を YES に変更します
変更後、vsftpd を再起動します。
> sudo service vsftpd restart
もう一度、Windows からログインしてみます。

今度はログインできました。
3. anonymous ユーザに権限を与える
通常、anonymous ユーザは、ダウンロードするのみで、アップロード等はさせないものですから、ここから先は、おすすめできない設定です。
ちょっと実験的にやってみました。
/etc/vsftpd.conf を再度編集します。
# Uncomment this to enable any form of FTP write command.
#write_enable=YES
↑
先頭の "#" をはずして有効にします
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
↑
先頭の "#" をはずして有効にします
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
anon_mkdir_write_enable=YES
↑
先頭の "#" をはずして有効にします
以下の3行を追加します。
↓
anon_umask=000
anon_other_write_enable=YES
anon_world_readable_only=NO
anonymous ユーザがログインする先は、ubuntu の場合、/srv/ftp になります。
グループ:ユーザが ftp:ftp になります。
anonymous ユーザ用のディレクトリを作成して所有者を変更します。
sudo mkdir /srv/ftp/work
chown ftp:ftp /srv/ftp/work
chmod 755 /srv/ftp/work
vsftpd を再起動します。
sudo service vsftpd restart
さて、この結果、できるようになったことを WinSCP で確認してみました。
結果は「WinSCP」のページでどうぞ。
|