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