我必须通过学校的 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
答案一直摆在我面前!这些行在这里:
我运行了“locate vpnc-script”,我发现由于某种原因它在我安装它时位于 /usr/share/vpnc/ 中。所以,我做了一个 mkdir /etc/vpnc 然后把 /usr/share/vpnc 里面的所有东西都移到那里,改变了适当的权限,瞧!有用!我 ssh 进入服务器并立即连接!这将使事情变得容易得多,因为我厌倦了使用我的虚拟机。