小编Cab*_*ero的帖子

使用密钥的 ssh 内联代理跳转不起作用

我需要通过代理跳转建立到远程服务器的连接。我正在尝试使用 -J 标志来做到这一点。据我了解,语法如下:

ssh -J A B
Run Code Online (Sandbox Code Playgroud)

但我需要对两个连接使用密钥文件。所以我尝试过这个:

ssh -J -i /path/proxy.pem user@proxy_host -i /path/target.pem user@target_host
Run Code Online (Sandbox Code Playgroud)

显然它不起作用,我得到了

option requires an argument -- i
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-E log_file] [-e escape_char]
           [-F configfile] [-I pkcs11] [-i identity_file]
           [-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec]
           [-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address]
           [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
           [user@]hostname [command]
ssh_exchange_identification: Connection closed by remote host
Run Code Online (Sandbox Code Playgroud)

在这种情况下,在不编辑 ssh 设置的情况下,正确的内联语法是什么?在这种情况下,密钥存储在哪个服务器上没有区别。

ssh ssh-tunnel

10
推荐指数
1
解决办法
1万
查看次数

标签 统计

ssh ×1

ssh-tunnel ×1