2012-05-31 4 views
2

공개 키 인증을 사용하는 Windows 용 OpenSSH를 사용하는 데 문제가 있습니다. 키 쌍을 생성하고 원격 서버에 키를 올바르게 전송했지만 Windows에서 ssh를 사용하면 암호를 묻는 메시지가 나타납니다. 내 개인 Mac에 동일한 개인 키를 전송하고 사용 권한이 너무 열려있는 오류 (644)가 표시되고 600으로 설정되어 있지 않으면 무시됩니다. "chmod 600 id_rsa"및 호이스트가 작동했습니다. 나는 스크립트를 통해 윈도우에서 이것을 바꿀 수있는 방법을 찾지 못했지만 나는 GUI와 그렇게 할 수 없다.OpenSSH 공개 키가 Cygwin에서 작동하지 않습니다.

이 작업을 수행하는 간단한 방법이 있어야합니까? 이 Windows 명령이 내장되어 있습니까? 필자는 현재 XP를 사용하고 있지만이 또한 비스타에서 작동, 7

EDIT3해야합니다 나는 FAT32 지원을 폐지하고 다운로드 전체 Cygwin에서 설치 단지 (문제를 진단하고 권한을 설정하는 chmod를 600을 사용하는있는 운 좋게 창을 동등하게 설정하십시오). 아직도 실패. 그래서 문제는 사용 권한이 아니라 키를 실패하게 만드는 다른 문제라고 생각합니다.

EDIT2가 : 나는 내가 원하는 것을 할 수있는 CACLS 명령을 발견 할 수 있지만, 그것은 단지 분명히 NTFS 파일 시스템에서 작동 나는 FAT32를 지원해야합니다.

EDIT1는 :

OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004 
debug2: ssh_connect: needpriv 0 
debug1: Connecting to SERVER.NAME.HERE.CA [134.153.48.1] port 22. 
debug1: Connection established. 
debug1: identity file /home/jtg733/.ssh/identity type -1 
debug3: Not a RSA1 key file /home/jtg733/.ssh/id_rsa. 
debug2: key_type_from_name: unknown key type '-----BEGIN' 
debug3: key_read: missing keytype 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug3: key_read: missing whitespace 
debug2: key_type_from_name: unknown key type '-----END' 
debug3: key_read: missing keytype 
debug1: identity file /home/jtg733/.ssh/id_rsa type 1 
debug1: identity file /home/jtg733/.ssh/id_dsa type -1 
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1-hpn13v11lpk 
debug1: match: OpenSSH_5.9p1-hpn13v11lpk pat OpenSSH* 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1 
debug1: SSH2_MSG_KEXINIT sent 
debug1: SSH2_MSG_KEXINIT received 
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman- group1-sha1 
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss 
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr 
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr 
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: none,zlib 
debug2: kex_parse_kexinit: none,zlib 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 
debug2: kex_parse_kexinit: ssh-rsa 
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour,aes192-cbc,aes256-cbc,aes128-ctr 
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour,aes192-cbc,aes256-cbc,aes128-ctr 
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: none,[email protected] 
debug2: kex_parse_kexinit: none,[email protected] 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_init: found hmac-md5 
debug1: kex: server->client aes128-cbc hmac-md5 none 
debug2: mac_init: found hmac-md5 
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 
debug2: dh_gen_key: priv key bits set: 127/256 
debug2: bits set: 534/1024 
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent 
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY 
debug3: check_host_in_hostfile: filename /home/jtg733/.ssh/known_hosts 
debug3: check_host_in_hostfile: match line 2 
debug3: check_host_in_hostfile: filename /home/jtg733/.ssh/known_hosts 
debug3: check_host_in_hostfile: match line 3 
debug1: Host 'SERVER.NAME.HERE.CA' is known and matches the RSA host key. 
debug1: Found key in /home/jtg733/.ssh/known_hosts:2 
debug2: bits set: 522/1024 
debug1: ssh_rsa_verify: signature correct 
debug2: kex_derive_keys 
debug2: set_newkeys: mode 1 
debug1: SSH2_MSG_NEWKEYS sent 
debug1: expecting SSH2_MSG_NEWKEYS 
debug2: set_newkeys: mode 0 
debug1: SSH2_MSG_NEWKEYS received 
debug1: SSH2_MSG_SERVICE_REQUEST sent 
debug2: service_accept: ssh-userauth 
debug1: SSH2_MSG_SERVICE_ACCEPT received 
debug2: key: /home/jtg733/.ssh/identity (0x0) 
debug2: key: /home/jtg733/.ssh/id_rsa (0x100e9cb8) 
debug2: key: /home/jtg733/.ssh/id_dsa (0x0) 
debug1: Authentications that can continue: publickey,password,hostbased 
debug3: start over, passed a different list publickey,password,hostbased 
debug3: preferred publickey,keyboard-interactive,password 
debug3: authmethod_lookup publickey 
debug3: remaining preferred: keyboard-interactive,password 
debug3: authmethod_is_enabled publickey 
debug1: Next authentication method: publickey 
debug1: Trying private key: /home/jtg733/.ssh/identity 
debug3: no such identity: /home/jtg733/.ssh/identity 
debug1: Offering public key: /home/jtg733/.ssh/id_rsa 
debug3: send_pubkey_test 
debug2: we sent a publickey packet, wait for reply 
debug1: Authentications that can continue: publickey,password,hostbased 
debug1: Trying private key: /home/jtg733/.ssh/id_dsa 
debug3: no such identity: /home/jtg733/.ssh/id_dsa 
debug2: we did not send a packet, disable method 
debug3: authmethod_lookup password 
debug3: remaining preferred: ,password 
debug3: authmethod_is_enabled password 
debug1: Next authentication method: password 

그래서 키를 얻을 테스트 패킷을 보낼 나타나고 바로 다음 라운드로 이동 : 나는 배 자세한 모드에서 OpenSSH를 실행하면, 이것은 내가 무엇을 얻을 인증.

답변

2

어떤 이유에서 키 서버 쪽을 생성 한 다음 scp를 사용하여 서버를 복사 한 개인 키를 서버에서 Windows 상자로 가져온 다음 cygwin chmod 600을 사용하여 매력처럼 작동했습니다.

나는 왜 서버가 Windows 공개 키를 받아들이지 않겠지 만 윈도우즈가 서버의 개인 키를 받아들이는지 전혀 모른다. 컴퓨터 부두처럼 보입니다.

0

win32security API를 사용하여 프로그래밍 방식으로 수행 할 수 있어야하지만보다 완벽한 답변을 제공하기 위해 ACL과 Windows에 대해 충분히 알지 못합니다.

또한 파일을 마우스 오른쪽 단추로 클릭하고 보안 페이지로 이동하여 설정해야합니다.

하지만 Windows에서 다른 문제가있을 수 있습니다. OpenSSH를 충분히 사용하지 않았습니다.

관련 문제