Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Auth-user-pass-verify /usr/local/sbin/verify.sh via-file not working/authenticat

    Scheduled Pinned Locked Moved OpenVPN
    1 Posts 1 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      m4f1050
      last edited by

      I need help with auth-user-pass-verify.  I was able to use this script on my dd-wrt router and it worked perfect, but when I try to use it on pfSense OpenVPN it does not authenticate me.  Can someone please help me fix this?

      
      #!/bin/sh
      
       ## format: username:password username:password ...
       ## you can even have same usernames with different passwords
       USERS='user1:pass1 user2:pass2 user3:pass3'
      
       ## you could put username:password in
       ## a separate file and read it like this
       #USERS=`cat file_with_users`
      
       vpn_verify() {
           if [[ ! $1 ]] || [[ ! $2 ]]; then
               #echo "No username or password: $*"
               exit 1
           fi
      
           ## it can also be done with grep or sed
           for i in $USERS; do
               if [[ "$i" == "$1:$2" ]]; then
      
                   ## you can add here logging of users
                   ## if you have enough space for log file
                   #echo `date` $1:$2 >> your_log_file
      
                   exit 0
               fi
           done
       }
      
       if [[ ! $1 ]] || [[ ! -e $1 ]]; then
           #echo "No file"
           exit 1
       fi
      
       ## $1 is file name which contains
       ## passed username and password
       vpn_verify `cat $1`
      
       #echo "No user with this password found"
       exit 1
      
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.