Jer*_*dev 8 authentication openvpn
是否可以使用用户名和密码连接到 openvpn 服务器。我读到你在 ubuntu 上需要一个配置文件,但我没有配置文件。
如何使用凭据连接到我的 openvpn 服务器?
Oct*_*ves 12
是的,这是可能的。为此,您已经安装了 OpenVPN 服务器,并在服务器中创建了用户。
最简单的 openvpn 客户端是网络管理器。如果您使用的是 Ubuntu,请运行:
aptitude install network-manager-openvpn
restart network-manager
Run Code Online (Sandbox Code Playgroud)
现在单击网络管理器小程序,选择配置 VPN,并设置一个新的 open-vpn 连接。将网关设置为您的服务器 将类型设置为密码 将您的 CA 指向您服务器的 ca.crt 的副本,一切都应该正常工作
附件是一个简单的客户端配置文件,它将起作用。在适当的地方编辑它以匹配您的服务器设置。你将需要这个和你的 ca.crt 在同一个目录中。
在 linux 上,我的文件名为 /etc/openvpn/client.conf
##############################################
# Sample client-side OpenVPN 2.0 config file.
# for connecting to multi-client server.
##############################################
# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
client
dev tun
proto udp
# The hostname/IP and port of the server.
remote my-server-2.domain 1194
# host name of the OpenVPN server. Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
resolv-retry infinite
# Most clients don't need to bind to
# a specific local port number.
nobind
# Try to preserve some state across restarts.
persist-key
persist-tun
# Certificate Authority
ca ca.crt
# Username/Password authentication is used on the server
auth-user-pass
# Verify server certificate by checking
# that the certicate has the nsCertType
# field set to "server". This is an
# important precaution to protect against
# a potential attack discussed here:
# http://openvpn.net/howto.html#mitm
#
# To use this feature, you will need to generate
# your server certificates with the nsCertType
# field set to "server". The build-key-server
# script in the easy-rsa folder will do this.
ns-cert-type server
# Set log file verbosity.
verb 3
# To start the openvpn client, simply type:
# openvpn --config /etc/openvpn/client.conf
Run Code Online (Sandbox Code Playgroud)
就是这样。