Skip to content

Instantly share code, notes, and snippets.

@10sr
Last active December 21, 2015 04:28
Show Gist options
  • Select an option

  • Save 10sr/6249459 to your computer and use it in GitHub Desktop.

Select an option

Save 10sr/6249459 to your computer and use it in GitHub Desktop.
vsftpd.conf for anonymous read-write access without any security configurations

vsftpd Configuration

LAN 内とかでセキュリティが必要ない ftp を vsftpd で立てる方法。 これに加えさらに同時にセキュリティが必要なユーザも利用する方法は知らない。

Directory Permission

vsftpd は、示した設定の他にパーミッションに少し気を使う必要がある。 完全に検証しきれてないけど、アクセスされるディレクトリ(この場合 /var/ftp)が write-enable だと多分 refusing to run with writable root inside chroot() というエラーが出る。 解決するには、

# chmod a-w /var/ftp

を実行する。 そして、他の場所からアクセスしやすくするように、

# mkdir /var/ftp/dir
# chmod a+w /var/ftp/dir

を実行する。

--- /etc/vsftpd.conf.orig 2013-08-13 22:57:30.161271912 +0900
+++ /etc/vsftpd.conf 2013-08-16 14:24:19.601858854 +0900
@@ -15,7 +15,7 @@
#local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
-#write_enable=YES
+write_enable=YES
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
@@ -24,11 +24,11 @@
# 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
+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
+anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain
@10sr
Copy link
Author

10sr commented Aug 16, 2013

LAN 内専用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment