
내 로컬 호스트에서 원격 서버로, 그리고 거기에서 원격 컴퓨터로 ssh를 찾고 있습니다. 현재 원격 컴퓨터와 원격 서버 사이에 비밀번호 없는 SSH가 설정되어 있지만 로컬 호스트에서 서버로 SSH를 연결한 다음 거기에서 컴퓨터로 SSH를 시도하면 다음과 같은 결과가 나타납니다.
Enter passphrase for key '/home/user/.ssh/id_dsa':
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).
원격 서버에 열려 있는 터미널에서 원격 컴퓨터로 SSH를 시도하면 정상적으로 작동합니다. 내 디스플레이가 가 아닌 것과 관련이 있습니까 :0.0
, 아니면 완전히 다른 것과 관련이 있습니까? 나는 노력했지만 xhost +local:
그 이상으로 길을 잃었습니다.
감사해요
답변1
두 시스템 모두 로컬 시스템의 공개 키를 갖고 있는 경우 -A
.
에서ssh(1)
-A Enables forwarding of the authentication agent connection. This can also be specified on a per-host basis in a configuration file.
또한 다음 경고에 유의하세요.
Agent forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the agent's UNIX-domain socket) can access the local agent through the forwarded connection. An attacker cannot obtain key material from the agent, however they can perform operations on the keys that enable them to authenticate using the identities loaded into the agent.
결과적으로 두 번째 호스트에 대해 인증할 때 인증은 물리적으로 상주하는 호스트로 다시 전달됩니다.
예:
me@host0:~ $ ssh -A host1
Last login: Thu Jun 14 11:31:53 2012 from 2001:db8::b0
me@host1:~ $ ssh -A host2
Last login: Thu Jun 14 11:41:05 2012 from 2001:db8::b1
me@host3:~ $ ssh -A host3
Last login: Tue Jun 12 10:46:50 2012 from 2001:db8::b2
me@host3:~ $
답변2
에이전트가 원격 컴퓨터에 인증을 전달할 수 없습니다. 원하는 경우 연결을 포트 전달하여 원격 시스템에 직접 연결할 수 있습니다.
보다SSH 멀티홉에 대한 이 기사다음 섹션으로 건너뛰세요.ProxyCommand
안에 ~/.ssh/config
:
Host remotecomputername
ProxyCommand ssh -q remoteservername nc -q0 remotecomputername 22