2012-04-07 12 views
1

나는 서버 1에서 서버 2에서 보내는 중입니다. id_rsa & id_rsa.pub 개의 파일을 생성했습니다. 내가 ssh를 mike @ server2로 잘 작동하지만 john @ ssh2에 대한 ssh는 암호 없이는 작동하지 않습니다. 마이크 & 존 홈 디렉토리는 chmod 700 인 ".ssh"를 포함하고 그 폴더는 이전에 생성 된 (그리고 chmod 600 인) id_rsa.pub 파일의 내용만을 포함하는 "authorized_keys"를 포함합니다. 둘 다의 내용은 동일 하.ssh 및 authorized_keys에 문제가 있습니다

서버 1 : 리눅스 x86_64에의 x86_64에의 x86_64의 GNU/리눅스

서버 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 .

~/스푸핑 drwx------ 2 mike mike 256 Nov 28 16:39 .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 .

~/스푸핑 drwx------ 2 john jgroup 256 Apr 06 23:56 .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

일반적인 원인 :

  • 권한이나 소유권 ~/스푸핑에 (난 당신이 사람들을 확인했습니다 참조)가 제대로 설정되지 않은
  • 공개 키가 손상
  • 공개 키가 개인 키와 다른 키를 사용합니다.

또한 서버의 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