ページ更新: 2004-07-10 (土) (6837日前)
関連: ソフト/proftpd proftpdを動かしてみたときのメモ。 目次 [編集]バージョン #$ cygcheck -cd proftpd cygrunsrv Cygwin Package Information Package Version cygrunsrv 0.98-3 proftpd 1.2.9-1 ちなみに、proftpdではないものだと、こんなのも入ってるけど、Linuxでほとんど使ったこと無いので……、設定をよく知らなかったり。 $ cygcheck -f /usr/sbin/in.ftpd inetutils-1.3.2-26 vsFTPdをCygwinに移植するって手もあるけど。 Jason Tishler - Re: cygwin vsFTPd porting issues [編集]文書 #Cygwinの以下の文書
ProFTPD - Professional FTP Daemon
手順 #[編集]proftpdをサービスに登録 #/usr/share/doc/Cygwin/proftpd-1.2.9.READMEを見て、以下のスクリプトを作成。 ファイル名はproftpd-config.shとする。 #!/bin/sh # File: proftpd-config.sh # Purpose: Installs proftpd daemon as a Windows service cygrunsrv --install proftpd \ --path /usr/sbin/proftpd.exe \ --args "--nodaemon" \ --type manual \ --disp "Cygwin proftpd" \ --desc "ProFTPD FTP daemon" "--type"はサービス起動の方法。自動=auto, 手動=manual。(man cygrunsrv) このスクリプトを実行すれば、proftpdがサービスとして登録される。 $ sh -x proftpd-config.sh + cygrunsrv --install proftpd --path /usr/sbin/proftpd.exe --args --nodaemon --t ype manual --disp Cygwin proftpd --desc ProFTPD FTP daemon[編集] モジュールの確認 #proftpdバイナリに含まれているモジュールを確認する。 必要なモジュールが含まれていない場合は、ソースコードを入手して、自分でコンパイルするべし。 $ /usr/sbin/proftpd --list Compiled-in modules: mod_core.c mod_xfer.c mod_auth_unix.c mod_auth_file.c mod_auth.c mod_ls.c mod_log.c mod_site.c ちなみに、Debian GNU/Linux Sarge (3.1になる?) のproftpdパッケージ(1.2.9-2)ではこのようになる。 $ /usr/sbin/proftpd --list Compiled-in modules: mod_core.c mod_xfer.c mod_auth_unix.c mod_auth_file.c mod_auth.c mod_ls.c mod_log.c mod_site.c mod_auth_pam.c mod_quotatab.c mod_ratio.c mod_tls.c mod_rewrite.c mod_radius.c mod_wrap.c mod_quotatab_file.c mod_readme.c mod_cap.c[編集] 設定ファイル #設定ファイル /etc/proftpd.conf を眺めておく。 設定を変えようと思ったら、パーミッションがこうなっていた。 $ ls -al proftpd.conf -rw-r--r-- 1 SYSTEM Administ 1826 Jun 4 2003 proftpd.conf Administratorsグループからは変更できるようにしておく。 $ chmod 664 proftpd.conf で、次の2行を追加。(時刻表示をGMTにしない、接続されたときにident(113/tcp)を見ない) TimesGMT off IdentLookups off 設定ファイルの文法を確認する。問題なし。 $ /usr/sbin/proftpd.exe --configtest Checking syntax of configuration file Syntax check complete.[編集] proftpdを起動する #$ net start proftpd ★手動でサービスを起動 Cygwin proftpd サービスを開始します. Cygwin proftpd サービスは正常に開始されました。 ログファイルでエラーがあるかどうか確認。 $ cat /var/log/proftpd.log :(略) 255.255.255.255 - ProFTPD 1.2.9 (stable) (built Mon Nov 3 10:36:51 EST 2003) standalone mode STARTUP で、/var/log/proftpd.logの内容を消したかったので、次のようにした。 $ pwd /var/log $ ls -l proftpd.log -rw-r--r-- 1 SYSTEM Administ 91640 Mar 21 21:34 proftpd.log $ chmod 644 proftpd.log $ cp /dev/null proftpd.log プロセスの確認。(ps -a とか ps -ef とか ps -Wで) $ ps -W | grep proftpd 3180 0 0 3180 ? 0 20:42:12 C:\cygwin\usr\sbin\proftpd.exe ポートの確認。 $ netstat -a | grep ftp TCP hostname:ftp hostname.examples.jp:0 LISTENING[編集] 接続してみる #普段使っているユーザ(Administratorグループに所属)とpostgres(Usersグループ)で試してみた。両方とも成功。 $ ftp localhost Connected to hostname.example.jp 220 ProFTPD 1.2.9 Server (ProFTPD Default Installation) [hostname.example.jp] Name (localhost:username): 331 Password required for username. Password: 230 User username logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp> ls -al 200 PORT command successful 150 Opening ASCII mode data connection for file list drwxrwxrwx 30 username なし 0 Mar 21 11:38 . drwxrwxrwx 8 Administrators Administrators 0 Mar 20 06:11 .. -rwxrwxrwx 1 username なし 1185 Jul 1 2003 .Xdefaults -rwxrwxrwx 1 username なし 426 Jul 1 2003 .Xresources -rwxrwxrwx 1 Administrators ????????::-1: 8634 Mar 21 05:36 .bash_history :(略)[編集] 付属のツールを試す #ftpwho, ftpcountも試してみた。(man proftpd) $ ftpwho standalone FTP daemon [4080], up for 8 min no users connected (ここで別のbashを起動して、ftp localhostしてから、) $ ftpwho standalone FTP daemon [4080], up for 9 min 2128 username [ 0m7s] 0m5s idle Service class - 1 user $ ftpcount Master proftpd process 4080: Service class - 1 user $ ftptop ftptop/0.9: Sun Mar 21 22:13:17 2004, up for 0 min 1 Total FTP Sessions: 0 downloading, 0 uploading, 0 idle PID S USER CLIENT SERVER TIME COMMAND 724 L username localhost 0.0.0.0:21 21 LIST -R ついでに、lastコマンドも試してみる。 $ last username ftpd2128 localhost Sun Mar 21 20:51 still logged in username ftpd1616 localhost Sun Mar 21 20:43 - 20:43 (00:00) postgres tty0 localhost Sun Feb 15 11:31 - 12:12 (00:40) :(略) wtmp begins Sat Nov 29 12:01:27 2003 ちなみにwtmp(/var/log/wtmp)のパーミッションは次の値。たぶん、touch /var/log/wtmp; chmod 666 /var/log/wtmp して作成した覚えがある。 $ ls -al /var/log/wtmp -rw-rw-rw- 1 username なし 6776 Mar 21 20:56 /var/log/wtmp[編集] ログファイル #$ cat /var/log/xferlog Sun Mar 21 20:56:35 2004 0 localhost 661 /d/username/lvm.png b _ o r username ftp1 * c Sun Mar 21 20:56:36 2004 0 localhost 3361 /d/username/md-lvm.png b _ o r username ftp 1 * c Sun Mar 21 20:56:37 2004 0 localhost 1921 /d/username/sample.png b _ o r username ftp 1 * c Sun Mar 21 20:56:38 2004 0 localhost 7834 /d/username/test.png b _ o r username ftp 1 * c[編集] トラブルシューティング #
設定の追加 #ここらへんは折を見て追加する予定。 DeferWelcome off MultilineRFC2228 on ShowSymlinks on TimeoutNoTransfer 600 TimeoutStalled 600 TimeoutIdle 1200 DisplayLogin welcome.msg DisplayFirstChdir .message LsDefaultOptions "-al" DefaultRoot ~ !hogehoge !hoge !hogehogehoge UseFtpUsers off HiddenStor on DenyFilter \*.*/ PathDenyFilter "^readme.eml$" <Directory /> Umask 022 022 <Limit LOGIN> Order Deny,Allow Deny from all Allow from 127.0.0.1, example.jp </Limit> </Directory> 2004-04-15 LsDefaultOptions は古いようだ。 $ /usr/sbin/proftpd.exe --configtest Checking syntax of configuration file - Fatal: LsDefaultOptions: deprecated. Use ListOptions instead |