在 bash 中连接到 Ubuntu 中的 VPN 连接

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18204670/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 06:14:00  来源:igfitidea点击:

Connect to a VPN Connection in Ubuntu in bash

linuxbashvpn

提问by Hossein Nasr

How can I connect to a VPN Connectionwhen I can use only bash (terminal)?

VPN Connection当我只能使用 bash(终端)时,如何连接到 a ?

I create a connection but I want to connect or disconnect using remote ssh connection

我创建了一个连接,但我想使用远程 ssh 连接进行连接或断开连接

回答by Hossein Nasr

you can use nmclito do that. this program is use for network management.

你可以nmcli用来做到这一点。该程序用于网络管理。

nmcli con up id <name_of_connection>

you need to save the password of that connection before you use this command. For more information, try man nmcli

在使用此命令之前,您需要保存该连接的密码。有关更多信息,请尝试man nmcli

any help on how to create VPN_CONNECTION in bash and how to manage them will appreciate

关于如何在 bash 中创建 VPN_CONNECTION 以及如何管理它们的任何帮助将不胜感激

回答by Knight71

Install the packages

安装软件包

  sudo apt-get install vpnc network-manager-vpnc network-manager-vpnc-gnome

and then from bash you can try

然后从 bash 你可以尝试

vpnc-connect vpn.conf

vpnc-connect vpn.conf

you need to supply the vpn configuration file as argument.

您需要提供 vpn 配置文件作为参数。