大网数据广告活动
服务器运维问答

Different identity files when jumping through hosts and using a single ssh config file

· 52CE 我爱测

Let's say I have the following setup: ssh ssh A ------> B ------> C ^ ^ using A's using B's key key I'm trying to configure this in .ssh/config in the host A as follows: Host C HostName C.com IdentityFile path_to_key_1 ProxyComma…

问题原文

原帖链接 · Amelio Vazquez-Reina · CC BY-SA 3.0

Let's say I have the following setup:

    ssh       ssh
A ------> B ------> C
    ^          ^
 using A's   using B's
   key         key

I'm trying to configure this in .ssh/config in the host A as follows:

Host C
    HostName C.com
    IdentityFile path_to_key_1
    ProxyCommand ssh -i path_to_key_2 B -W %h:%p

Which identify file and path go into path_to_key_1 and path_to_key_2 ?

For example, does path_to_key_1 refer to a path in A and path_to_key_2 to a path in B? Or are they both supposed to be paths in A?

已采纳解答

原帖链接 · Zoredache · CC BY-SA 3.0

The ProxyCommand is executed from 'A', this makes a connection to B that only creates a tunnel to 'C' which is then used for 'A' to connect to 'C'. At no point is a shell opened on B, or any ssh keys loaded from B.

If you require a key for authentication that only lives on 'B' to authenticate to 'C' you won't be able to use the 'ProxyCommand'.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-10-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。