差分
この文書の現在のバージョンと選択したバージョンの差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン 最新リビジョン 両方とも次のリビジョン | ||
os:freebsd:openssh-portable:start [2011/01/15 00:03] yuki |
os:freebsd:openssh-portable:start [2012/02/12 00:34] yuki |
||
---|---|---|---|
ライン 9: | ライン 9: | ||
---- | ---- | ||
>メモ | >メモ | ||
+ | |||
+ | * SFTPのみに制限したい場合は、ユーザまたはグループのコマンドをForceCommandで強制する。 | ||
+ | * <code>Match group sftponly | ||
+ | ChrootDirectory /mnt/sftpdir | ||
+ | ForceCommand internal-sftp</code> | ||
* internal-sftpのログをとりたい。 | * internal-sftpのログをとりたい。 | ||
ライン 25: | ライン 30: | ||
* sftpのログがURIエンコードされて困る | * sftpのログがURIエンコードされて困る | ||
* http://bompopo.wordpress.com/2009/11/07/openssh%e3%81%ae%e3%83%ad%e3%82%b0%e3%81%8curi%e3%82%a8%e3%83%b3%e3%82%b3%e3%83%bc%e3%83%89%e3%81%95%e3%82%8c%e3%81%a6%e5%9b%b0%e3%82%8b/ | * http://bompopo.wordpress.com/2009/11/07/openssh%e3%81%ae%e3%83%ad%e3%82%b0%e3%81%8curi%e3%82%a8%e3%83%b3%e3%82%b3%e3%83%bc%e3%83%89%e3%81%95%e3%82%8c%e3%81%a6%e5%9b%b0%e3%82%8b/ | ||
+ | * 冷静に考えて、pythonの標準関数で書いたら超簡潔だった。 | ||
+ | * <code>root@nazuna ~# cat sftp_log_encoding.py | ||
+ | #!/usr/local/bin/python | ||
+ | # -*- coding: utf-8 -*- | ||
+ | |||
+ | logfile = open("/var/log/sftp.log") | ||
+ | txt = logfile.read() | ||
+ | output = open("/var/log/sftp.utf-8.log",'w') | ||
+ | output.write(txt.decode('string_escape')</code> |