Page 1 of 1
Preventing multiple logins
Posted: Fri Oct 05, 2012 9:40 pm
by arjunking
[This has been moved to Authentication Scripts]
Hi,
I have installed OpenVPN System Based On User/Password Authentication with mysql & Day Control (shell script) on centos 6 64 bit.
to install I followed this tutorial :
http://chagridsada.blogspot.fr/2011/01/ ... rpass.html
It is perfectly setup and I have tested it with multiple servers.
But now I can have multiple logins with the same account. So how should I prevent this?
I want to limit to maximum of 1 login per account.
Please help me
Many thanks ,
Arjun
Re: Preventing multiple logins
Posted: Sat Oct 06, 2012 8:19 pm
by xauen
well, you have 2 options here:
1. Use a client connect/disconnect script on the openvpn server that triggers 1 if user is "online" and triggers a 0 if the user has been "offline" and an sql checking on the script to read the database.
If user1 is online (meaning 1 in the database table) then exit 1 (afaik its reject user) else exit 0
Option 2: (little harder though much more flexible)
2. Setup radius+mysql authentication for openvpn and set Simultaneous-Use = 1 in the radgroupcheck table.
Either of them is usable for your purpose.
Re: Preventing multiple logins
Posted: Sun Oct 07, 2012 7:16 pm
by arjunking
HI
thanks for your reply
I tried the first one but sometimes in case of improper disconnection , the script doesn't return user_online=0 even though i have kept "keepalive 5 30" so user remains online according to the database and hence can't relogin
can you please provide a link for tutorial of mysql+radius+openvpn installation?
Re: Preventing multiple logins
Posted: Sun Oct 07, 2012 9:31 pm
by xauen
put:
on udp config only
my tutorial on using radius-mysql will be available soon when im a little free.
Re: Preventing multiple logins
Posted: Sun Oct 07, 2012 9:35 pm
by arjunking
Thanks a lot man

waiting for your tutorial
please make it as detailed as possible
Re: Preventing multiple logins
Posted: Sun Oct 07, 2012 9:48 pm
by arjunking
it wont start now

tried to restart openvpn but it fails to
I am using it in server mode so I presume it can't be used in it
any fix for it?
Re: Preventing multiple logins
Posted: Mon Oct 08, 2012 6:24 am
by xauen
arjunking wrote:it wont start now

tried to restart openvpn but it fails to
I am using it in server mode so I presume it can't be used in it
any fix for it?
sorry I forgot to tell you it should be in the client config UDP
Re: Preventing multiple logins
Posted: Mon Oct 08, 2012 8:15 pm
by arjunking
thanks it worked
but now i have installed freeradius
didn't know how to add accounts in freeradius so installed daloradius
and now i added a user in daloradius and i am getting auth fail error
any idea on how to use daloradius with openvpn? any tutorial links will be welcomed
Re: Preventing multiple logins
Posted: Mon Oct 08, 2012 8:33 pm
by xauen
arjunking wrote:thanks it worked
but now i have installed freeradius
didn't know how to add accounts in freeradius so installed daloradius
and now i added a user in daloradius and i am getting auth fail error
any idea on how to use daloradius with openvpn? any tutorial links will be welcomed
This might help!
http://safesrv.net/setup-freeradius-plu ... pn-source/
For more information on Freeradius and how to customize it please consult with Daloradius and Freeradius documentation.
Re: Preventing multiple logins
Posted: Mon Oct 08, 2012 8:42 pm
by arjunking
thanks for your fast reply
i followed this tutorial but now i am stuck.
i don't know how to add the user.
this tutorial no where explains how to add an openvpn user
please help
i am sorry for so many questions
or please suggest me a simpler control panel than daloradius
Re: Preventing multiple logins
Posted: Tue Oct 09, 2012 9:13 am
by xauen
arjunking wrote:thanks for your fast reply
i followed this tutorial but now i am stuck.
i don't know how to add the user.
this tutorial no where explains how to add an openvpn user
please help
i am sorry for so many questions
or please suggest me a simpler control panel than daloradius
As i've said, you need to customize the radius database and radius configuration based on your openvpn setup.
This is not a freeradius and daloradius support forum so you can only get support from their respective community.
http://freeradius.org/doc/
since the topic is all about radius and authentication system I have moved this topic to Authentication Scripts forum.
Re: Preventing multiple logins
Posted: Tue Oct 09, 2012 9:36 pm
by arjunking
someone please help me
i am getting auth failed error
Re: Preventing multiple logins
Posted: Tue Oct 23, 2012 11:37 am
by xauen
Please refer to Freeradius documentation on how to customize and link your MySql db to Radius system.