在 Debian/Ubuntu 上安装 Pritunl VPN 客户端

[ad_1]

在我们之前的指南中,我们学习了如何在 Debian 上安装和设置 Pritunl VPN Server。 本教程将带您了解如何在 Debian/Ubuntu 系统上安装 Pritunl VPN 客户端,以便您能够连接到您的 VPN 服务器并能够访问远程 LAN 中的其他系统。

在 Debian/Ubuntu 上安装 Pritunl VPN 客户端

在 Debian/Ubuntu 上安装 Pritunl APT 存储库

为了在 Debian/Ubuntu 系统上安装 Pritunl VPN 客户端,您需要首先通过运行以下命令来安装 Pritunl 存储库;

在 Ubuntu/Debian 上安装 Pritunl 存储库;

echo "deb https://repo.pritunl.com/stable/apt $(lsb_release -sc) main" > /etc/apt/sources.list.d/pritunl.list

在 Ubuntu/Debian 上安装 Pritunl 存储库;

apt install apt-transport-https dirmngr
apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A 

运行系统更新;

apt update

在 Debian/Ubuntu 上安装 Pritunl VPN 客户端

存储库就位后,运行以下命令在 Debian/Ubuntu 上安装 Pritunl VPN 客户端。

在桌面系统上,您可以安装 pritunl-client-electron VPN客户端包;

apt install pritunl-client-electron

在服务器系统上,您可以简单地使用 pritunl-client VPN 客户端包;

apt install pritunl-client

连接到 Pritunl VPN 服务器

在 Pritunl VPN 服务器上添加用户和组织

在您可以从客户端连接到 Pritunl VPN 服务器之前,您需要已创建用户和组织。 按照下面的链接创建 Pritunl VPN 服务器用户和组织。

在 Pritunl VPN 服务器上添加用户和组织

从没有桌面环境的服务器连接到 Pritunl VPN 服务器

如果您在没有 GUI 界面的服务器上运行,您可以使用 pritunl-client 连接到 Pritunl VPN 服务器。

的基本命令行用法 pritunl-client 是;

pritunl-client
Pritunl Client Command Line Tool

Usage:
  pritunl-client [flags]
  pritunl-client [command]

Available Commands:
  add         Add profile
  completion  generate the autocompletion script for the specified shell
  help        Help about any command
  list        List profiles
  logs        Show logs for profile
  remove      Remove profile
  start       Start profile
  stop        Stop profile
  version     Show version
  watch       Watch profiles

Flags:
  -h, --help   help for pritunl-client

Use "pritunl-client [command] --help" for more information about a command.

因此,例如,在我们的 Pritunl VPN 服务器中,我们添加了两个演示用户,如上所示。

假设您想以上述用户之一的身份连接到 Pritunl VPN 服务器,例如来自您的 Ubuntu/Debian 服务器的演示用户,使用 pritunl-client,那么您只需运行以下命令;

pritunl-client add [profile_uri]

在哪里 [profile_uri] 是 Pritunl VPN 服务器上用户配置文件的 uri。 您可以从 Pritunl VPN 服务器,用户的配置文件中获取用户的配置文件 URI。 请参阅下面的屏幕截图;

因此,如果您在 Pritunl VPN 服务器上使用受信任的 SSL 证书,那么您可以使用以下示例命令直接导入配置文件;

pritunl-client add pritunl://pritunl.kifarunix-demo.com/ku/pw6pDiJZ

通过运行命令列出可用的配置文件;

pritunl-client list

使用 pritunl-client start 命令;

pritunl-client start -h
Start profile

Usage:
  pritunl-client start [profile_id] [flags]

Flags:
  -h, --help              help for start
  -m, --mode string       VPN mode (ovpn, wg)
  -p, --password string   VPN password

从桌面系统连接到 Pritunl VPN 服务器

从桌面系统,您可以使用 Pritunl 客户端连接到 Pritunl VPN 服务器。 只需从应用程序菜单启动它。 它看起来像这样;

从 Pritunl 服务器下载用户的配置文件并导入客户端。

您也可以获取配置文件 URI 并从 URI 导入。

在我们的演示中,我们下载了演示用户的配置文件并按如下方式导入。

wget -P ~/Downloads/ https://pritunl.kifarunix-demo.com/key/guxJ2EedzAC8dkodgKoYJTtjGpYpFnp3.tar --no-check-certificate
cd ~/Downloads
tar xf guxJ2EedzAC8dkodgKoYJTtjGpYpFnp3.tar
ls -alh .
...
-rw-r--r--  1 koromicha koromicha  20K Mar 17 01:59 guxJ2EedzAC8dkodgKoYJTtjGpYpFnp3.tar
-rw-------  1 koromicha koromicha 9.7K Mar 17 01:59 kifarunix-demo.com_demo_kifarunix-demo-vpn.ovpn

所以我们有 ovpn 配置文件。

要导入配置文件,只需单击 导入配置文件 并选择您的 .ovpn 文件从您的特定系统位置。

导入配置文件后,Pritunl 客户端将显示如下所示;

要连接,请单击右上角的菜单行,然后单击 连接.

来自客户端的连接状态;

验证IP地址;

ip add
4: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/none 
    inet 192.168.241.2/24 brd 192.168.241.255 scope global tun0
       valid_lft forever preferred_lft forever
    inet6 fe80::8906:20df:b6f4:ef97/64 scope link stable-privacy 
       valid_lft forever preferred_lft forever

Pritunl VPN 服务器的连接状态;

使用 OpenVPN 客户端连接;

您可以使用连接 openvpn 客户;

sudo openvpn ~/Downloads/kifarunix-demo.com_demo_kifarunix-demo-vpn.ovpn

其他连接方式

使用网络管理器命令行工具;

nmcli connection import type openvpn file ~/Downloads/kifarunix-demo.com_demo_kifarunix-demo-vpn.ovpn

同样,您也可以从 Gnome 或 KDE 网络连接设置导入保存的 .ovpn 配置。

这标志着关于如何在 Debian/Ubuntu 上安装 Pritunl VPN 客户端的教程结束。

参考和进一步阅读

Pritunl VPN 连接

Pritunl Gnome 客户端

相关教程

在 Ubuntu 20.04/18.04 上自动连接到 VPN

在 Ubuntu 20.04/Ubuntu 18.04 上安装 FortiClient VPN 客户端

在 CentOS 8/Ubuntu 18.04 上使用网络管理器连接到 OpenVPN

在 Ubuntu 上使用 PCF 文件连接到 Cisco VPN

在 Ubuntu 20.04 上安装和设置 OpenVPN 服务器

[ad_2]

Related Posts