<center id="qkqgy"><optgroup id="qkqgy"></optgroup></center>
  • <menu id="qkqgy"></menu>
    <nav id="qkqgy"></nav>
    <xmp id="qkqgy"><nav id="qkqgy"></nav>
  • <xmp id="qkqgy"><menu id="qkqgy"></menu>
    <menu id="qkqgy"><menu id="qkqgy"></menu></menu>
    <tt id="qkqgy"><tt id="qkqgy"></tt></tt>

  • 1、配置OpenVPN
    vim /etc/openvpn/checkpsw.sh #!/bin/sh
    ########################################################### # checkpsw.sh (C)
    2004 Mathias Sundman # # This script will authenticate OpenVPN users against #
    a plain text file. The passfile should simply contain # one row per user with
    the username first followed by # one or more space(s) or tab(s) and then the
    password. PASSFILE="/etc/openvpn/psw-file"
    LOG_FILE="/etc/openvpn/openvpn-password.log" TIME_STAMP=`date "+%Y-%m-%d %T"`
    ########################################################### if [ ! -r
    "${PASSFILE}" ]; then echo "${TIME_STAMP}: Could not open password file
    \"${PASSFILE}\" for reading." >> ${LOG_FILE} exit 1 fi CORRECT_PASSWORD=`awk
    '!/^;/&&!/^#/&&$1=="'${username}'"{print $2;exit}' ${PASSFILE}` if [
    "${CORRECT_PASSWORD}" = "" ]; then echo "${TIME_STAMP}: User does not exist:
    username=\"${username}\", password=\"${password}\"." >> ${LOG_FILE} exit 1 fi
    if [ "${password}" = "${CORRECT_PASSWORD}" ]; then echo "${TIME_STAMP}:
    Successful authentication: username=\"${username}\"." >> ${LOG_FILE} exit 0 fi
    echo "${TIME_STAMP}: Incorrect password: username=\"${username}\",
    password=\"${password}\"." >> ${LOG_FILE} exit 1
    2、改變權限
    chmod +x /etc/openvpn/checkpsw.sh
    ?3、配置密碼賬號文件
    vim /etc/openvpn/psw-file # 前面為用戶名,后面為密碼。 中間使用空格分開 tom1 123456 test test
    4、服務器端修改
    vim /etc/openvpn/server.conf # 最后一行加入 script-security 3 auth-user-pass-verify
    /etc/openvpn/checkpsw.sh via-env username-as-common-name verify-client-cert none
    5、客戶端 client.ovpn
    client dev tun proto tcp remote 192.168.1.71 1194 resolv-retry infinite nobind
    persist-key persist-tun ca ca.crt #注釋這兩行 ;cert admin.crt ;key admin.key
    remote-cert-tls server tls-auth ta.key 1 cipher AES-256-GCM comp-lzo verb 3
    #加入這一行,使用用戶名密碼登錄openvpn服務器 auth-user-pass
    ?6、重啟后連接
    systemctl restart openvpn@server

    技術
    下載桌面版
    GitHub
    百度網盤(提取碼:draw)
    Gitee
    云服務器優惠
    阿里云優惠券
    騰訊云優惠券
    華為云優惠券
    站點信息
    問題反饋
    郵箱:ixiaoyang8@qq.com
    QQ群:766591547
    關注微信
    巨胸美乳无码人妻视频