おのたく日記 YouTubeも始めました→
2012-03-18(Sun) [長年日記]
■ [Debian] 久しぶりにftpdを復活
Webカメラからauto detectでメールすると余分な物が沢山送られてくるので、Webで確認できるようにするためにWebカメラからFTPで送られるようにするためにftpdが必要になった。
以前は、wu-ftpdを使っていたけど、最近の流行はvsftpd(Very Secure FTPd)らしいので、これを使うことにした。
# aptitude install vsftpd
いつもプロセスが立ち上がってるのはなんなので
# /etc/init.d/vsftpd stop
# update-inetd --add "ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/vsftpd"
として、止めてからinetd起動のため/etc/vsftpd.confを書き換えた
--- vsftpd.conf.org 2012-01-08 19:09:34.000000000 +0900
+++ vsftpd.conf 2012-02-27 16:15:17.593929711 +0900
@@ -11,7 +11,7 @@
#
# Run standalone? vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
-listen=YES
+#tkyn listen=YES
#
# Run standalone with IPv6?
# Like the listen parameter, except vsftpd will listen on an IPv6 socket
@@ -20,17 +20,21 @@
#listen_ipv6=YES
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
-anonymous_enable=YES
+#tkyn anonymous_enable=YES
+anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
#local_enable=YES
+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)
#local_umask=022
+local_umask=022
#
# 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
@@ -127,6 +131,7 @@
# 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
#
# Customization
#
@@ -145,3 +150,9 @@
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/private/vsftpd.pem
+
+#add by http://www005.upp.so-net.ne.jp/develop-tom/deb/vsftpd-deb.html
+userlist_enable=YES
+userlist_deny=NO
+userlist_file=/etc/vsftpd.user_list
+local_root=public_html
[/etc/vsftpd.confより引用]
ftpで入れるユーザを/etc/vsftpd.user_listに並べて完成。
chroot_local_user=YESにもしたかったけど、vsftpd 2.3.5あたりからホームディレクトリを書き込み禁止にしないと接続できないようなのであきらめた。
|