SSH 在 Windows 虚拟机中有效,但在本机 Ubuntu 机器上无效

SSH 在 Windows 虚拟机中有效,但在本机 Ubuntu 机器上无效

我必须通过学校的 VPN 连接到 Linux 服务器。我可以通过我的 Windows 虚拟机使用 Putty 进行连接,也可以连接到 VPN(Cisco AnyConnect),但我无法在我的本机 Ubuntu 机器上连接。VPN 通过我的终端成功,但不能 ssh。我尝试 ping 服务器,但它只是在那里。当我尝试 ssh 进入服务器时,我收到“连接超时”的提示。

如果我可以在虚拟机上进行连接,是什么阻止了我连接?有什么建议吗?

笔记:我没有透露真实姓名和 IP。

以下是连接到 VPN 时的输出:

christopher@HAL:~$ sudo openconnect -s /etc/vpnc/vpnc-script https://secureconnect.some_university.edu
[sudo] password for christopher: 
POST https://secureconnect.some_university.edu/
Attempting to connect to server xx.xx.xx.xx:443
SSL negotiation with secureconnect.some_university.edu
Connected to HTTPS on secureconnect.some_university.edu
Got HTTP response: HTTP/1.0 302 Object Moved
GET https://secureconnect.some_university.edu/
Attempting to connect to server xx.xx.xx.xx:443
SSL negotiation with secureconnect.some_university.edu
Connected to HTTPS on secureconnect.some_university.edu
Got HTTP response: HTTP/1.0 302 Object Moved
GET https://secureconnect.some_university.edu/+webvpn+/index.html
SSL negotiation with secureconnect.some_university.edu
Connected to HTTPS on secureconnect.some_university.edu
Please enter your username and password.
GROUP: [xxxxx]:xxxxx <-- leaving name out
Please enter your username and password.
Username:<my_username>
Password:xxxxxxxxx   
POST https://secureconnect.some_university.edu/+webvpn+/index.html
Got CONNECT response: HTTP/1.1 200 OK
CSTP connected. DPD 30, Keepalive 20
/bin/sh: 1: /etc/vpnc/vpnc-script: not found
Script '/etc/vpnc/vpnc-script' returned error 127
/bin/sh: 1: /etc/vpnc/vpnc-script: not found
Script '/etc/vpnc/vpnc-script' returned error 127
Connected tun0 as 192.168.30.106, using SSL
Established DTLS connection (using GnuTLS). Ciphersuite (DTLS0.9)-(RSA)-(AES-256-CBC)-(SHA1).

这是我连接到 VPN 后尝试 ssh 进入服务器的过程:

christopher@HAL:~$ ssh -v xxxxxxx.some_university.edu
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for xxxxxxx.some_university.edu
debug1: Connecting to uisacad.uis.edu [xxx.xxx.xxx.xxx] port 22.
debug1: connect to address xxx.xxx.xxx.xxx port 22: Connection timed out
ssh: connect to host xxxxxxx.some_university.edu port 22: Connection timed out

答案1

答案一直就在我眼前!这些行如下:

/bin/sh: 1: /etc/vpnc/vpnc-script: not found <-- realized it here
Script '/etc/vpnc/vpnc-script' returned error 127 
/bin/sh: 1: /etc/vpnc/vpnc-script: not found
Script '/etc/vpnc/vpnc-script' returned error 127

我运行了“locate vpnc-script”,发现不知为何它在我安装时位于 /usr/share/vpnc/ 中。因此,我创建了 mkdir /etc/vpnc,然后将 /usr/share/vpnc 中的所有内容移到那里,更改了适当的权限,然后瞧!它成功了!我通过 ssh 进入服务器,它立即连接上了!这会让事情变得容易得多,因为我已经厌倦了使用虚拟机。

相关内容