Код: Выделить всё
ssh ssh
A ------> B ------> C
^ ^
using A's using B's
ssh key ssh key
- А запускает ssh-агент
- A может получить доступ к B
- B может получить доступ к C
- A не может получить прямой доступ к C
- Открытый ключ ssh пользователя A присутствует в B:~/.ssh/authorized_keys
- Открытый ключ ssh пользователя B присутствует в C:~/.ssh/authorized_keys
После этого вопроса я попробовал соответствующий ответ, вот мой .ssh/ конфигурация
Код: Выделить всё
Host proxy
HostName 10.10.10.10
User foo
Port 1234
IdentityFile ~/.ssh/id_rsa
Host target
HostName 11.11.11.11
User bar
Port 5678
ProxyCommand ssh -o 'ForwardAgent yes' proxy 'ssh-add && nc %h %p'
Код: Выделить всё
$ ssh -t proxy ssh bar@11.11.11.11 -p 5678
Код: Выделить всё
$ ssh -t proxy ssh target
ssh: Could not resolve hostname target: Temporary failure in name resolution
Connection to 10.10.10.10 closed.
$ ssh target
Could not open a connection to your authentication agent.
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535
Код: Выделить всё
Host proxy
HostName 10.10.10.10
User foo
Port 1234
IdentityFile ~/.ssh/id_rsa
Host target
HostName 11.11.11.11
User bar
Port 5678
ProxyCommand ssh -W %h:%p proxy
Я хотел бы просто запустите ssh target, но я застрял. Если бы кто-то мог помочь! Спасибо большое!
Подробнее здесь: https://stackoverflow.com/questions/786 ... e-key-on-b
Мобильная версия