2012-04-07 13 views
1

私はサーバ1からサーバ2です。 id_rsa & id_rsa.pubファイルを生成しました。もし私がsshをmike @ server2にしても正常に動作しますが、john @ server2へのsshはパスワードなしでは動作しません。 mike & johnホームディレクトリには、chmod 700である ".ssh"が含まれており、そのフォルダには以前に生成されたid_rsa.pubファイルの内容のみを含む "authorized_keys"が含まれています(chmod 600)。両方の内容は同じです。sshとauthorized_keysで問題が発生しました

サーバー1:Linuxのx86_64版のx86_64 x86_64のGNU/Linuxの

サーバー2:AIX 5.3.0.0 64ビット

コマンド1、ユーザーマイクは(パスワードなしで動作します): ssh -v -n -o StrictHostKeychecking=no -o NumberOfPasswordPrompts=0 [email protected] echo Hello

drwx------ 7 mike mike 4096 Jan 19 2011 .

の〜/ .ssh drwx------ 2 mike mike 256 Nov 28 16:39 .ssh

の〜/ .ssh /著者ized_keys -rw------- 1 mike mike 823 Apr 06 11:56 .ssh/authorized_keys


コマンド2、ユーザジョン(パスワードが必要) ssh -v -n -o StrictHostKeychecking=no -o NumberOfPasswordPrompts=0 [email protected] echo Hello

drwx------ 12 john jgroup 4096 Apr 06 23:13 .

の〜/ .ssh drwx------ 2 john jgroup 256 Apr 06 23:56 .ssh

の〜/ .ssh/authorized_keysに-rw------- 1 john jgroup 414 Apr 06 11:55 .ssh/authorized_keys

上記のssh -v出力コマンド2:

OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: Applying options for * 
debug1: Connecting to server2 [X.X.X.X] port 22. 
debug1: Connection established. 
debug1: identity file /home/will/.ssh/identity type -1 
debug1: identity file /home/will/.ssh/id_rsa type 1 
debug1: identity file /home/will/.ssh/id_dsa type -1 
debug1: loaded 3 keys 
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.0 
debug1: match: OpenSSH_5.0 pat OpenSSH* 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_4.3 
debug1: SSH2_MSG_KEXINIT sent 
debug1: SSH2_MSG_KEXINIT received 
debug1: kex: server->client aes128-cbc hmac-md5 none 
debug1: kex: client->server aes128-cbc hmac-md5 none 
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent 
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP 
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent 
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY 
debug1: Host 'server2' is known and matches the RSA host key. 
debug1: Found key in /home/will/.ssh/known_hosts:838 
debug1: ssh_rsa_verify: signature correct 
debug1: SSH2_MSG_NEWKEYS sent 
debug1: expecting SSH2_MSG_NEWKEYS 
debug1: SSH2_MSG_NEWKEYS received 
debug1: SSH2_MSG_SERVICE_REQUEST sent 
debug1: SSH2_MSG_SERVICE_ACCEPT received 

This network/computer system is for the use of authori... 
......................................................... 

debug1: Authentications that can continue: publickey,password,keyboard-interactive 
debug1: Next authentication method: publickey 
debug1: Trying private key: /home/will/.ssh/identity 
debug1: Offering public key: /home/will/.ssh/id_rsa 
debug1: Authentications that can continue: publickey,password,keyboard-interactive 
debug1: Trying private key: /home/will/.ssh/id_dsa 
debug1: Next authentication method: keyboard-interactive 
debug1: Next authentication method: password 
debug1: No more authentication methods to try. 
Permission denied (publickey,password,keyboard-interactive). 

誰もが、それは一人のユーザーで動作する理由のアイデアを持っていない別の(との両方が同じサーバー上にありますか)?キーで認証に失敗した

答えて

2

一般的な原因:

  • アクセス権や所有権の〜/ .sshに(私はあなたがそれらをチェックした参照)が正しく設定されていない
  • 公開鍵が壊れてい
  • 公開鍵、秘密鍵

チェックも、サーバのauth.logより別のキーです。

+0

公開鍵/秘密鍵に問題があった場合、他のIDへの接続にも影響しませんか? – askmike1

+0

「公開鍵は秘密鍵とは異なる鍵用です」ということに注意してください。ファイルのサイズから、最初のアカウントのauthorized_keysに別のキーがあると思います。おそらく他の鍵は実際にあなたがsshで使用されているものでしょうか? –

+0

mikeのauthorized_keysから他のキーを削除しましたが、それでもそのユーザーと一緒に働いていました。 – askmike1

0

あなたがマイクとしてログインできるのは本当のスタンパーです。あなたはauthorized_keys2ファイルを作ってみるかもしれません。 authorized_keysはOpenSSHのすべてのバージョンで動作しません。

ln -s authorized_keys authorized_keys2 
関連する問題