玄箱DebianにFTP over SSLいれる
なんか普通にFTPでwav転送したら、ファイル所々壊れていて困った*1…
おかしいな。VPN内でも距離の問題が発生するか。*2
というわけでデータ整合性が保証されているsftp か ftp over ssl に移行する。
sftpは基本的に重いので^^;
現地でftpできるようにFTP over SSL の拡張モードを使う。*3
apt 更新。常に最新。apt病
apt-get update
apt-get upgrade
opensslのパッケージをインストール
鍵もついでに作成
apt-get install openssl
mkdir /var/local/certs/
openssl req -new -x509 -nodes -out /var/local/certs/server.crt -keyout /var/local/certs/server.key
ftp鯖/proftp インストール
apt-get install proftpd
たいしてconf 弄ってないのでinstall the package maintainer's version する
最近のは、SSL実装済でパッチ当てなくても、"TLSEngine on" できる
すげぇべんり
/etc/proftpd.conf は ほぼでふぉです
ServerName "Debian" ServerType inetd DeferWelcome off ShowSymlinks on MultilineRFC2228 on DefaultServer on ShowSymlinks on AllowOverwrite on TimeoutNoTransfer 600 TimeoutStalled 600 TimeoutIdle 1200 DisplayLogin welcome.msg DisplayFirstChdir .message # LsDefaultOptions "-l"*4 DenyFilter \*.*/ # Uncomment this if you are using NIS or LDAP to retrieve passwords: #PersistentPasswd off Port 21 MaxInstances 30 # Set the user and group that the server normally runs at. User nobody Group nogroup # Normally, we want files to be overwriteable.# Umask 022 is a good standard umask to prevent new files and dirs # (second parm) from being group and world writable. Umask 022 022 AllowOverwrite on # -------------------------------------- # SSL/TLS # -------------------------------------- TLSEngine on TLSLog /var/log/proftpd.tls.log TLSProtocol SSLv23 TLSCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP # Are clients required to use FTP over TLS when talking to this server? TLSRequired on # Server's certificate TLSRSACertificateFile /var/local/certs/server.crt TLSRSACertificateKeyFile /var/local/certs/server.key # Authenticate clients that want to use FTP over TLS? TLSVerifyClient off # --------------------------------------
FAQ ですが、
が来た場合、FTP クライアントがAuth SSLを投げていないです。
設定を FTP over SSL 拡張モード?( Auth つかうほう)にして接続しましょう
また、
コマンド: AUTH SSL
応答: 234 AUTH SSL successful
状況: SSL接続が確立されました. ウェルカムメッセージを待っています...
コマンド: USER *****
エラー: タイムアウトが検出されました!
エラー: 接続できません!
の場合は PASVモードで通信しようとしてる可能性があります。
鍵交換にPASVだとだめっぽいのでActiveモード(PORTモード)を使用しましょう
# 以上ふぁいるじらー用の説明でした