mmtaee / ocserv-users-management

ocserv installation and user web-panel management.
96 stars 44 forks source link

Authentication Failure (pam-auth pam_auth_pass : Authentication failure) #32

Closed pencilvania closed 1 year ago

pencilvania commented 1 year ago

I have successfully installed ocserv on an Ubuntu 20.04 server using the provided install.sh script. However, I encountered an issue when attempting to create a user and log in. The server generates the following error message:

pam-auth pam_auth_pass : Authentication failure

This issue prevents users from authenticating and accessing the VPN server.

Steps to Reproduce:

Install ocserv on an Ubuntu 20.04 server using the install.sh script. Create a user account using panel. Attempt to log in with the newly created user account. Observe the "Authentication failure" error. Expected Behavior: I expected to be able to create a user account and log in to the ocserv VPN server without encountering authentication errors.

Additional Information:

Operating System: Ubuntu 20.04 Installation Method: install.sh script provided with ocserv-users-management. Any relevant logs or error messages should be included here for further diagnosis. image

mmtaee commented 1 year ago

The authentication of panel and ocserv is plain. you try to use pam authentication method. the users will be store in file /etc/ocserv/ocpasswd and auth method is : auth="plain[passwd=/etc/ocserv/ocpasswd]"

try command below to create a test user in server: echo test\ntest\n | sudo ocpasswd -c /etc/ocserv/ocpasswd test
or try to create from pannel in http://YOUR_SERVER_IP in user tab

then try in client side to connect with command below: sudo openconnect -u test YOUR_IP_ADDRESS:OCSERV_PORT password is : test default oscerv port: 20443

If there is an error, please report the bug, so that I can fix it. After test remove user from panel or delete user from file /etc/ocserv/ocpasswd

pencilvania commented 1 year ago

@mmtaee I tested with commands , but I cannot login again

when I use anyconnect app I get pam authentication method

but when I using with command line it cannot pass Auth Screenshot 2023-09-25 at 17 21 30

mmtaee commented 1 year ago

This part is not Ocserv password. It is related to the password of the system administrator (sudo) .