[nanasi@2ch]~% ssh1 host.somewhere.com Last login: Fri Mar 16 11:50:43 2001 from 2ch Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved.
20010322 - (djm) Better AIX no tty fix, spotted by Gert Doering <gert@greenie.muc.de> - (djm) Released 2.5.2p2
20010321 - (djm) Fix ttyname breakage for AIX and Tru64. Patch from Steve VanDevender <stevev@darkwing.uoregon.edu> - (djm) Make sure pam_retval is initialised on call to pam_end. Patch from Solar Designer <solar@openwall.com> - (djm) Don't loop forever when changing password via PAM. Patch from Solar Designer <solar@openwall.com> - (djm) Generate config files before build - (djm) Correctly handle SIA and AIX when no tty present. Spotted and suggested fix from Mike Battersby <mib@unimelb.edu.au>
http://sysadmin.oreilly.com/news/silverman_1200.html the SSH-1 public-key user-authentication method is also vulnerable; the attacker may use the signed authenticator from the client side to access the client's account on the server. However, the SSH-2 public-key and host-based client authentication methods are MITM-proof: the authenticators involved are bound to session identifiers that are forced to be different on either side of the attacker.
debug1: got SSH2_MSG_SERVICE_ACCEPT debug1: authentications that can continue: publickey,password,keyboard-interactive debug1: next auth method to try is publickey debug1: try privkey: /home/******/.ssh/id_rsa debug1: try privkey: /home/******/.ssh/id_dsa debug1: next auth method to try is password
クライアント側 win98 + TTSSH + FFFTP IP:192.168.0.2 SSH Port Forwarding local 8021 to remote machine "192.168.0.3" port 21
>FFFTP以外のftpクライアントで試すとどうなる?
NextFTP(試用期間です。制限は無いと思うです)で、以下のようなログです。
----ここから NextFTP Ver2.10 2002(C)Toxsoft
ホストを探しています - localhost ホストに接続しています - localhost (127.0.0.1) 220-=(<*>)=-.:. (( Welcome to PureFTPd 1.0.7 )) .:.-=(<*>)=- 220-You are user number 1 of 3 allowed 220-Local time is now 23:27 and the load is 0.00. Server port: 21. 220-This is a private system - No anonymous login 220 You will be disconnected after 5 minutes of inactivity. >USER hogehoge 331 User hogehoge OK. Password required >PASS ******** 230-User hogehoge has group access to: ftpgroup operator wheel hogehoge 230 OK. Current restricted directory is / >XPWD 257 "/" is your current location ファイルリストを取得しています... >TYPE A 200 TYPE is now ASCII >PASV 227 Entering Passive Mode (192,168,0,3,174,47). >LIST 421 Timeout < ホストから切断されました。 > < エラー : コマンドを送信できませんでした。 (1057-0) > < エラー : コマンドを送信できませんでした。 (1052-0) > < エラー : 転送はキャンセルされました。 (1055-10038) > < ファイルの一覧を取得できませんでした。 > < ホストに接続できませんでした。 > ----ここまで
あと、参考になるわかりませんが LIST で停止する時 FreeBSD で netstat すると、
Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp4 0 0 hogehoge3.43504 hogehoge2.1248 FIN_WAIT_2 tcp4 0 0 hogehoge3.43504 *.* LISTEN tcp4 0 0 hogehoge3.ftp hogehoge3.1061 ESTABLISHED tcp4 0 0 hogehoge3.1061 hogehoge3.ftp ESTABLISHED tcp4 0 20 hogehoge3.ssh hogehoge4.1230 ESTABLISHED
Feb 2 12:34:56 onakaippai sshd[24248]: [ID 800047 auth.info] scanned from 123.123.123.123 with SSH-1.0-SSH_Version_Mapper. Don't panic. Feb 2 12:34:56 onakaippai sshd[24244]: [ID 800047 auth.info] Did not receive identification string from 123.123.123.123.
プロバの鯖がtelnetでしか入れないので、ユーザ権限でsshdを動かしたいです。 環境はsolaris。バイナリのssh、sshd、ssh-keygenがあります。 SSH Version 1.2.27 [sparc-sun-solaris2.5.1], protocol version 1.5. ちと古くてアレなんですが、コンパイルする環境がないので、これより新しいのは用意できません。
#これは余談ですが、x86のLinux/FreeSolaris上でクロスコンパイルとかできます?
現状:パスワード認証不可、RSA認証も不可です。
$ ssh -v -p 22222 nanashi@solaris.puge.ne.jp SSH Version OpenSSH-1.2.3, protocol version 1.5. Compiled with SSL. debug: Reading configuration data /home/nanashi/.ssh/config debug: Reading configuration data /etc/ssh/ssh_config debug: Applying options for * debug: ssh_connect: getuid 1000 geteuid 1000 anon 1 debug: Connecting to solaris.puge.ne.jp [2xx.xxx.xxx.xxx] port 22222. debug: Connection established. debug: Remote protocol version 1.5, remote software version 1.2.27 debug: Waiting for server public key. debug: Received server public key (768 bits) and host key (1024 bits). debug: Host 'solaris.puge.ne.jp' is known and matches the host key. debug: Encryption type: 3des debug: Sent encrypted session key. debug: Installing crc compensation attack detector. debug: Received encrypted confirmation. debug: Trying RSA authentication with key 'nanashi@hoge.com' debug: Server refused our key. debug: Doing password authentication. nanashi@solaris.puge.ne.jp's password: Permission denied, please try again. nanashi@solaris.puge.ne.jp's password:
>>437 $ ./sshd -d -f sshd_config debug: sshd version 1.2.27 [sparc-sun-solaris2.5.1] debug: Initializing random number generator; seed file /etc/ssh_random_seed log: Server listening on port 22222. log: Generating 768 bit RSA key. Generating p: ..++ (distance 52) Generating q: ...++ (distance 16) Computing the keys... Testing the keys... Key generation complete. log: RSA key generation complete. debug: Server will not fork when running in debugging mode. log: Connection from 2xx.xxx.xxx.xxx port 4854 log: Could not reverse map address 2xx.xxx.xxx.xxx. debug: Client protocol version 1.5; client software version OpenSSH-1.2.3 debug: Sent 768 bit public key and 1024 bit host key. debug: Encryption type: 3des debug: Received session key; encryption turned on. debug: Installing crc compensation attack detector. debug: Can't find nanashi's shadow - access denied.
Important Changes(重要な変更点): ================================== ・ホスト認証鍵や設定ファイルなどのディレクトリのデフォルトが /etc/ssh に 変更された。 ・ssh-keygen コマンドは、もはや特定の鍵タイプ(すなわちrsa1)をデフォルト とはしないようになった。すなわち、ユーザは必ず -t オプションで作成したい 鍵のタイプ(rsa,dsa,rsa1のいずれか)を指定しなければならない。 ・sshdのX転送機能は、デフォルトではローカルホストをlistenするようになった。 もし、X11クライアントアプリケーションがこの変更により動作しなくなった場合、 sshdの設定ファイル(訳注:sshd_configのこと)の X11UseLocalhost オプショ ンを変更して以前の動作に戻せばよい。 原文:sshd x11 forwarding listens on localhost by default; see sshd X11UseLocalhost option to revert to prior behaviour if your older X11 clients do not function with this configuration
Other Changes(その他の変更点): ================================ ・sshクライアントのエスケープ文字の1つ~&が両方のバージョンのSSHプロトコル で動作するようになった。 ・sshdの ReverseMappingCheck オプションは、意味がより分かりやすい VerifyReverseMapping と いう名前のオプションになった。従来通り、 ReverseMappingCheck という名前 で設定することも可能である。 ・使用された公開鍵(訳注:ユーザ認証鍵の公開鍵)の指紋が LogLevel=VERBOSE の ときにログとして記録されるようになった。 ・シェルが存在しないなどの理由でログインが許可されなかった場合、その理由が ログとして記録されるようになった。 ・X転送におけるエラー処理を強化した。 ・……意味不明 (T_T) …… 原文:improved packet/window size handling in ssh2 ・regex(3)を使用しなくなった。 ・sshdで SIGCHLD races が発生するという現象(Solarisで発生する)を 対策???……意味不明 (T_T) …… 原文:fix SIGCHLD races in sshd (seen on Solaris) ・sshdに -o オプションが新設された。 ・sftpに -B, -R, -P オプションが新設された。 ・ssh-add コマンドは、3つのデフォルトのユーザ認証鍵すべてを認証エージェント に登録する追加する 原文:ssh-add now adds all 3 default keys ・ssh-keyscan コマンドのバグフィックス ・……意味不明 (T_T) …… 原文:ssh-askpass for hostkey dialog ・……意味不明 (T_T) …… 原文:fix fd leak in sshd on SIGHUP ・……意味不明 (T_T) …… 原文:TCP_NODELAY set on X11 and TCP forwarding endpoints
セキュリティ関係の変更点(adv.channelalloc): 1.影響を受けるシステム バージョン2.0から3.0.2までのすべてのリリースには channel code に off-by-one エラーが含まれています。 原文:All versions of OpenSSH between 2.0 and 3.0.2 contain an off-by-one error in the channel code.
3.1以降のバージョンではこの問題は解決されています。 2.影響 この脆弱性を持ったSSHサーバにログインしている正規のユーザによって、 SSHサーバに…(不明)…。また、この脆弱性を持ったSSHクライアントに 悪意を持ったSSHサーバがattackすることによっても同様の…(不明)…。 原文:This bug can be exploited locally by an authenticated user logging into a vulnerable OpenSSH server or by a malicious SSH server attacking a vulnerable OpenSSH client. 3.解決方法 次のパッチ(訳注:省略させていただきました)を適用するか、バージョン3.1 以降を使用することによってこの問題は解決されます。 4.Credits このバグは Joost Pol <joost@pine.nl> 氏によって発見されました。
> This bug can be exploited locally by an authenticated user > logging into a vulnerable OpenSSH server or by a malicious > SSH server attacking a vulnerable OpenSSH client.
上の書き方からして RSA しか念頭になかったんでしょうが、そうだと しても P と Q だけならともかく、D mod (P-1) や D mod (Q-1)、さ らには Q^(-1) mod P まで保存されているので、これらを指して『両 方の鍵を生成するのに必要な数値』と言ってしまっては全然厳密じゃ ないでしょう。
.bashrc --------------------------------------------------- # 関数 sshon1: 鍵がまだ追加されてなければ追加する。 function sshon1 { if [ ! "$SSH_AUTH_SOCK" ]; then echo 'SSH_AUTH_SOCK is not set.'; return 1; fi if ! (ssh-add -l 2>&1 | grep '(RSA1)'); then ssh-add ~/.ssh/identity; fi } # ssh1: エージェントに鍵がなければ、鍵を追加してから ssh 実行。 function ssh1 { sshon1 && command ssh $*; }
> Using XDMCP is inherently insecure, therefore, most of the > distributions shipped as it's XDMCP default turned off. If you > must use XDMCP, be sure to use it only in a trusted networks, > such as corporate network within a firewall. Unfortunately, > XDMCP uses UDP, not TCP, therefore, it is not natively able to > use it with SSH. To secure the connection with SSH, the > technique is called X11 TCP/IP Port Forwarding.
新規でOpenSSH-3.2.2p1を入れたのだが、何故かパスワードの認証は駄目・・・ RAS認証は通るのに何故でしょう? 手順は以下 OpenSSL 0.9.6cを./configure make make install zlib1.1.4を./config make make install OpenSSH-3.2.2p1を./configure --with-pam make make install した。 cp contrib/redhat/sshd.init /etc/rc.d/init.d/sshd chmod +x /etc/rc.d/init.d/sshd /sbin/chkconfig --add sshd cp contrib/redhat/sshd.pam /etc/pam.d/sshd
Port 22 Protocol 1 HostKey /usr/local/etc/ssh_host_key KeyRegenerationInterval 3600 ServerKeyBits 768 SyslogFacility AUTH LogLevel INFO LoginGraceTime 600 PermitRootLogin no RSAAuthentication yes AuthorizedKeysFile .ssh/authorized_keys RhostsAuthentication no RhostsRSAAuthentication no IgnoreUserKnownHosts no PasswordAuthentication yes PermitEmptyPasswords no ChallengeResponseAuthentication yes X11Forwarding no X11DisplayOffset 10 X11UseLocalhost yes KeepAlive yes UseLogin no UsePrivilegeSeparation no Subsystem sftp /usr/local/libexec/sftp-server
- クライアント及びサーバの設定オプションに関する説明はそれぞれ ssh_config(5)とsshd_config(5)に移動しました。 - サーバ(sshd)では新しく Compression オプションがサポートされるようにな りました。sshd_config(5)をご参照下さい。 - クライアント(ssh)のオプションである RhostsRSAAuthentication 及び RhostsAuthentication のデフォルトは no になりました。ssh_config(5)参照。 - クライアント(ssh)のオプションである FallBackToRsh 及び UseRsh は 廃止されました。 - …意味不明だ(T_T)… 原文:ssh-agent now supports locking and timeouts for keys, see ssh-add(1). - …これも意味不明(T_T)… 原文:ssh-agent can now bind to unix-domain sockets given on the command line, see ssh-agent(1). - PuTTYをクライアントとして使用していた場合、validな(←どういう訳がいい か分からない^^;)RSA署名にもかかわらず発生していた問題をfixしました。
> ssh-agent now supports locking and timeouts for keys, see ssh-add(1). エージェントを一時的に「ロックさせる機能」がついたということです。 あと、鍵を追加するときにその鍵の(エージェント中での)最大生存時間を指定できるようになりますた。
> ssh-agent can now bind to unix-domain sockets given on the command line, see ssh-agent(1). ssh-agent は通信用にAF_UNIXドメインソケットを使っていて、いままではこれは /tmp/ssh-ほにゃららにバインドされて、このディレクトリは決め打ちで変えられなかったのだが、 これがオプションで変えられるよになった、ということ。
>>781 http://marc.theaimsgroup.com/?l=openssh-unix-dev&m=101680346025114&w=2 でも USER が root ですね。 手元のlsof(revision: 4.59)のmanのUSERの項: > However, on Linux USER is the user ID number or login that owns the directory in /proc > where lsof finds information about the process. > Usually that is the same value reported by ps(1), but may differ when > the process has changed its effective user ID.
> openssh (1:3.4p1-1) testing; urgency=high > > * thanks to the security team for their work > * no thanks to ISS/Theo de Raadt for their handling of these bugs
>>889 $ man ssh-keygen . . . -t type Specifies the type of the key to create. The possible values are ``rsa1'' for protocol version 1 and ``rsa'' or ``dsa'' for protocol version 2.
> HostKeyAlias > Specifies an alias that should be used instead of the real host > name when looking up or saving the host key in the host key > database files. This option is useful for tunneling ssh connec- > tions or for multiple servers running on a single host.
$ cat set_agent_socket for as in `find /tmp -name 'agent.*' -type s -user $USER`; do if SSH_AUTH_SOCK=$as ssh-add -l; then SSH_AUTH_SOCK=$as export SSH_AUTH_SOCK break fi done > /dev/null 2>&1 $ unset SSH_AUTH_SOCK $ ssh-add -l Could not open a connection to your authentication agent. $ . set_agent_socket $ ssh-add -l 1024 c2:c7:13:37:07:eb:a6:03:e3:3a:9a:26:c5:f5:b4:92 *************** (RSA1) 2048 89:23:bb:cc:38:b2:99:a7:d2:c7:81:da:56:9a:4a:d3 ********************** (RSA) 1024 10:d2:ce:c0:89:1f:37:bc:b5:2e:f5:95:ee:d4:98:64 ********************** (DSA) $
うん、結構便利かもしんない。しかし、
>>969 > 最近Mac OS Xを使いはじめて、こまっていることがあります。 > OS XのemacsはGUI使うやつは現在コマンドラインから > たちあげらんないので、上のような手段が使えないんです。