ITeye博客

[更新]ubuntu linux如何"导入"openvpn配置文件启动登陆

vfate_linux · 2014-05-17 23:05 · 互联网 · Ubuntu · 导入 · openvpn · Markdown

假如你是ubuntu14.04 的用户 你会发现open vpn的导入功能暂时无法使用,貌似bug... 写了个导入运行脚本,从终端启动openvpn [code="shell"]sudo apt-get install openvpn [/code] run-openvpn.sh "导入"启动 openvpn脚本代码如下 [code="shell"]#!/bin/bash OVPN_FILE="$1" get_crt() { local file_name="$1" local ca_file="${file_name}-ca.crt" start_line=`grep -n '' "$file_name" |awk -F':' '{ print $1 }'` end_line=`grep -n '' "$file_name" |awk -F':' '{ print $1 }'` end_line=`expr $end_line - 1` count=`expr $end_line - $start_line` head -$end_line "$file_name" |tail -$count > "$ca_file" echo "$ca_file" } ca_file=`get_crt "$OVPN_FILE"` sudo openvpn --client --config "$OVPN_FILE" --ca "$ca_file" [/code] 比如你下载的openvpn配置文件名字是:xxx-xxx.ovpn [code="shell"]run-openvpn.sh xxx-xxx.ovpn[/code] 运行过程中提示输入用户名密码,有的不用用户名密码,最后看到如下提示表示vpn已经连接上了: [quote]Sat May 17 22:19:23 2014 Initialization Sequence Completed [/quote] 附件中的文件是供大家测试使用 [code="shell"] #解压附件的7z文件 7z x -pqwert openvpn-test.7z [/code] 参考:[url]http://askubuntu.com/questions/450493/openvpn-cant-import-configurations-on-new-14-04-installation[/url]

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。