2011-12-21 2 views
4

저는 Git에 매우 익숙합니다. 내 클라이언트가 내 시스템에 git을 설치하도록 요청하고 ssh 키 (id_rsa.pub)를 전달하라고 명령했습니다. 키를 전송하고 등록한 후 앱을 다운로드 할 수있었습니다.하나의 시스템에서 Git SSHKey를 다른 시스템으로 전송할 수 있습니까?

그런 다음 Fedora 14 (Linux)로 이동하기로 결정했습니다. 자식을 다시 설치했고 서버에 클라이언트 등록을 위해 키를 다시 전송했습니다. 하지만 이제 고객이 언급 한 동일한 키를 사용할 수 있습니다.

동일한 키를 사용할 수 있습니까?

나는 아래의 단계를 시도 : (일단 자식은 페도라에 설치되었다.)

  1. ssh-keygen -t rsa -C "[email protected]" (같은 이메일 ID 윈도우 OS에서 사용)의 사본으로 작성
  2. 대체 모든 3 개 개의 파일을 3 개 파일

git clone [email protected]:x2.git하지만 행운을 시도 (윈도우에서 id_rsa_gsg_keypair를, id_rsa.pub과에서 known_hosts 이전 설치).

내가하려고하면 :

git clone [email protected]:x2.git 
Cloning into x2... 
ssh: connect to host git.xyz.com port 22: connection timed out 
fatal: The remote end hung up unexpectedly. 

누군가가 이해하고이 문제를 해결 좀 도와 줄래? 액세스를 잠그는 다른 문제가 있습니까?

미리 감사드립니다.

+1

는 않습니다 'telnet git.xyz.com 22'는 작동합니까? –

+0

nope connection timed out .. 뭔가 차단이 있습니까? – Rakesh

+0

서버에서 직접 실행해도 동일한 명령이 작동합니까? –

답변

5

ssh 개인 키는 컴퓨터에 묶여 있지 않으며 한 컴퓨터에서 다른 컴퓨터로 복사 할 수 있으며 공용 키가있는 서버로 ssh (따라서 git 사용) 할 수 있어야합니다. 키를 다시 만들고 사본 등으로 교체 할 필요는 없지만 키의 관점에서 수행 한 작업조차도 문제가되지 않습니다.

오류는 ssh: connect to host git.xyz.com port 22: connection timed out fatal이며 상자에 서버에 대한 액세스 권한이없는 것 같습니다.

2

@manojlds에 언급 된대로 ssh 키를 복사 할 수 있습니다. 개인적으로 개발 기계를 통해이 작업을 수행했습니다.

연결 시간이 ssh 데몬이 실행되지 않아서 발생한 것 같습니다. 당신이 컴퓨터에 연결할 수 있도록하려면 sshd를 실행중인 경우 당신은

root  726  1 0 08:07 ?  00:00:00 /usr/sbin/sshd -D 

을 받아야 다음과 같은 진단

ps -ef | grep sshd 

을 실행하십시오, 이중 열쇠에 대한 권한을 확인하고 강제로 0700

로 설정 당신이

를 얻을 경우
cd .ssh 
chmod -R 0700 *  #Read only to the user only 

ssh -v <user>@<host>을 실행 해보십시오

초기 핸드 셰이크가 실패했기 때문에 sshdaemon에 문제가 있습니다.성공적인 의사 소통은 다음과 같습니다.

OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: Applying options for * 
debug1: Connecting to 192.168.0.xxx [192.168.0.xxx] port 22. 
debug1: Connection established. 
debug1: identity file /home/xxx/.ssh/id_rsa type 1 
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048 
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048 
debug1: identity file /home/xxx/.ssh/id_rsa-cert type -1 
debug1: identity file /home/xxx/.ssh/id_dsa type -1 
debug1: identity file /home/xxx/.ssh/id_dsa-cert type -1 
debug1: identity file /home/xxx/.ssh/id_ecdsa type -1 
debug1: identity file /home/xxx/.ssh/id_ecdsa-cert type -1 
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.6 
debug1: match: OpenSSH_5.6 pat OpenSSH* 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_5.8p1 Debian-1ubuntu3 
debug1: SSH2_MSG_KEXINIT sent 
debug1: SSH2_MSG_KEXINIT received 
debug1: kex: server->client aes128-ctr hmac-md5 none 
debug1: kex: client->server aes128-ctr 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: Server host key: RSA zz 
The authenticity of host '192.168.0.xxx (192.168.0.xxx)' can't be established. 
RSA key fingerprint is zzzzz. 
Are you sure you want to continue connecting (yes/no)? yes 
Warning: Permanently added '192.168.0.xxx' (RSA) to the list of known hosts. 
debug1: ssh_rsa_verify: signature correct 
debug1: SSH2_MSG_NEWKEYS sent 
debug1: expecting SSH2_MSG_NEWKEYS 
debug1: SSH2_MSG_NEWKEYS received 
debug1: Roaming not allowed by server 
debug1: SSH2_MSG_SERVICE_REQUEST sent 
debug1: SSH2_MSG_SERVICE_ACCEPT received 
debug1: Authentications that can continue: publickey,keyboard-interactive 
debug1: Next authentication method: publickey 
debug1: Offering RSA public key: /home/parj/.ssh/id_rsa 
debug1: Server accepts key: pkalg ssh-rsa blen 279 
debug1: Authentication succeeded (publickey). 
Authenticated to 192.168.0.xxx ([192.168.0.xxx]:22). 
debug1: channel 0: new [client-session] 
debug1: Requesting [email protected] 
debug1: Entering interactive session. 
debug1: Sending environment. 
debug1: Sending env LANG = en_GB.UTF-8 
Last login: Wed Dec 21 16:46:48 2011 
0

LocalUser는 Lu이고 RemoteUser는 Ru입니다.

루 $에서 mkdir ~/스푸핑

루 $ scp를 usernameOfRu @ ipOfRu : 스푸핑/* 스푸핑/*

usernameOfRu ipOfRu의 암호 @ : "원격 시스템의 암호를 입력합니다"

관련 문제