我的 Ubuntu 电脑上有两个代理(两个 IP 地址)连接,我试图ssh
使用“corkscrew”连接到我的大学超级计算机,但无法连接,失败了,因为
Couldn't establish connection to proxy: Connection timed out
kex_exchange_identification: Connection closed by remote host
你能帮我一下吗?
我能够按照相同的过程从另一台只有一个ip
输出ssh -v
:
sachin@localhost:~$ ssh -v [email protected]
OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /home/sachin/.ssh/config
debug1: /home/sachin/.ssh/config line 1: Applying options for *.compunet.barc.in
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Executing proxy command: exec corkscrew compunetgw.barc.gov.in 8080 atulya.compunet.barc.in 22 ~/.ssh/proxyauth
debug1: identity file /home/sachin/.ssh/id_rsa type 0
debug1: identity file /home/sachin/.ssh/id_rsa-cert type -1
debug1: identity file /home/sachin/.ssh/id_dsa type -1
debug1: identity file /home/sachin/.ssh/id_dsa-cert type -1
debug1: identity file /home/sachin/.ssh/id_ecdsa type -1
debug1: identity file /home/sachin/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/sachin/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/sachin/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/sachin/.ssh/id_ed25519 type -1
debug1: identity file /home/sachin/.ssh/id_ed25519-cert type -1
debug1: identity file /home/sachin/.ssh/id_ed25519_sk type -1
debug1: identity file /home/sachin/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/sachin/.ssh/id_xmss type -1
debug1: identity file /home/sachin/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
Couldn't establish connection to proxy: Connection timed out
kex_exchange_identification: Connection closed by remote host
输出ip a
sachin@localhost:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:e0:4c:68:12:d2 brd ff:ff:ff:ff:ff:ff
inet 10.143.111.41/24 brd 10.143.111.255 scope global noprefixroute enp1s0
valid_lft forever preferred_lft forever
inet6 fe80::b3fe:fd97:d21c:6b88/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 70:85:c2:ba:10:14 brd ff:ff:ff:ff:ff:ff
inet 10.15.111.45/24 brd 10.15.111.255 scope global noprefixroute enp4s0
valid_lft forever preferred_lft forever
inet6 fe80::b524:bbb9:23f7:32e9/64 scope link noprefixroute
valid_lft forever preferred_lft forever
输出ip route
sachin@localhost:~$ ip route
default via 10.143.111.1 dev enp1s0 proto static metric 20100
default via 10.15.111.1 dev enp4s0 proto static metric 20101
10.15.91.230 via 10.15.111.1 dev enp4s0
10.15.111.0/24 dev enp4s0 proto kernel scope link src 10.15.111.45 metric 101'
10.143.111.0/24 dev enp1s0 proto kernel scope link src 10.143.111.41 metric 100'
90.3.15.135 via 10.15.111.1 dev enp4s0
169.254.0.0/16 dev enp1s0 scope link metric 1000
答案1
我认为ip route show
仍然显示相同的输出。
运行以下命令并尝试再次连接:
$ip route add default via 10.143.111.1 dev enp1s0 proto static metric 20102
$ip route del default via 10.143.111.1 dev enp1s0 proto static metric 20100
[编辑]
若操作不允许,请以root权限执行:
$sudo ip route add default via 10.143.111.1 dev enp1s0 proto static metric 20102
$sudo ip route del default via 10.143.111.1 dev enp1s0 proto static metric 20100