SSH 에이전트 전달, 다중 홉

SSH 에이전트 전달, 다중 홉

저는 Linux 원래 컴퓨터를 사용하여 이 설정을 테스트했습니다. 모든 것이 동일합니다. 첫 번째 홉만 원래 컴퓨터의 키를 사용할 수 있습니다.

원래 질문

다중 홉을 사용하여 SSH 에이전트 전달을 설정하려고 합니다. 내 로컬 컴퓨터는 퍼티와 미인 대회가 설치된 Windows이고 모든 Linux 컴퓨터는 Debian 7입니다.

문제는 내 개인 키가 Windows에서 시작되었으며 첫 번째 홉에서만 유효하다는 것입니다. 첫 번째 머신에 추가된 개인 키는 어디에서나 사용할 수 있습니다.

첫 번째 홉 시스템은 "vpn1"이라고 하고 두 번째 홉 시스템은 "www1"이라고 합니다. "vpn1"은 인터넷과 인트라넷(10.1.0.1)에 연결되어 있습니다. "www1"은 인트라넷(10.1.0.10)에만 연결됩니다. 'vpn1' 추가 키([이메일 보호됨]) "ssh-add"를 사용하면 이 키가 미인 대회에 나타납니다.

디버그

다음 위치에서 키 3개를 모두 볼 수 있습니다 ssh-add -L.

ssh-rsa [pubkey-1] [email protected] //This is github key originating from Windows
ssh-rsa [pubkey-2] [email protected] //This is SSH key originating from Windows
ssh-rsa [pubkey-3] [email protected] //This is SSH key originating from 'vpn1'

"vpn1"에서 다운로드하려고 하면ssh -v -T [email protected]

debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: [email protected]
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: Authentication succeeded (publickey).

"www1"부터 시작하려고 하면ssh -v -T [email protected]

debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: [email protected]
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: [email protected]
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: [email protected]
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: /home/enbyted/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/enbyted/.ssh/id_dsa
debug1: Trying private key: /home/enbyted/.ssh/id_ecdsa
debug1: Next authentication method: password

'만 허용하는 호스트의 SSH에도 동일하게 적용됩니다.[이메일 보호됨]' 열쇠. 하지만 SSH를 통해 원하는 만큼 홉을 만들 수 있습니다.[이메일 보호됨]'. 물론 git 명령도 마찬가지입니다.

구성

광산 ~/.ssh/config(모든 서버에서 동일):

Host 10.1.0.*
    ForwardAgent yes

Host *
    ForwardAgent no

내 것 /etc/ssh/sshd_config(코멘트 없음, 모든 서버에서 동일):

Port <custom-port>
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin no
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes

질문

  • 그렇다면 왜 이런가요?
  • 내가 뭘 잘못했나요?

또한 "www1"에서 github이 두 가지 인증 방법, 즉 비밀번호와 공개 키를 제공한다는 것이 이상합니다... SSH를 통해 github.com에 연결하는 "www1"이 "vpn1" 서버와 동일한 서버에 연결되어 있다고 확신합니다.

업데이트 #1: 이미지의 네트워크 설정

이 이미지의 출처는 참고해주세요기사, 하지만 내 설정이 거의 표시됩니다.

           네트워크 설정 이미지

그래서 집 컴퓨터에 2개의 키가 있고 루아페후(vpn1)에 하나가 있습니다.

내 집 PC에서 루아페후에 SSH로 접속하면 세 개의 키를 모두 잘 사용할 수 있습니다. 하지만 ruapehu(vpn1)에서 aoraki(www1)로 다시 ssh를 수행하면 ruapehu의 키만 사용할 수 있습니다.

aoraki(www1)에서 아래 호스트 중 하나로 SSH를 연결하면 홉 수에 관계없이 ruapehu의 키만 작동합니다.

홈 PC가 Putty + pageant를 사용하는 Windows이거나 ssh-agent를 사용하는 Linux인 경우에는 그렇지 않습니다.

답변1

귀하의 문제는 PuTTY 구성에 있다고 생각합니다. 이 전달 설정은 다음과 같이 확인해야 합니다.

                     SS대화

인용하다

관련 정보