Kicking a user off after 30 minutes idle (server side)?

This forum is for admins who are looking to build or expand their OpenVPN setup.
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
phoney
OpenVPN User
Posts: 11
Joined: Wed Aug 29, 2018 8:20 am

Kicking a user off after 30 minutes idle (server side)?

Post by phoney » Wed Aug 29, 2018 8:26 am

After 30 minutes I am wanting to kick the user from our VPN network, this is because we get charged for every connection open and people leave their connections open on their laptops. I can add a client-side configuration to remove them from our server, but the user can modify their OpenVPN conf file and remove these 4 lines (which are shown below).

auth-nocache
inactive 900
ping 10
ping-exit 60

Is there a way on the server side, that kicks the user off after 30 minutes? Or checks to see if they modified their config file?

Any information would be much appreciated

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 5015
Joined: Fri Jun 03, 2016 1:17 pm

Re: Kicking a user off after 30 minutes idle (server side)?

Post by TinCanTech » Wed Aug 29, 2018 12:26 pm

phoney wrote:
Wed Aug 29, 2018 8:26 am
because we get charged for every connection open and people leave their connections open on their laptops
phoney wrote:
Wed Aug 29, 2018 8:26 am
Is there a way on the server side, that kicks the user off after 30 minutes?
Try using --inactive 900 in the server config ..
phoney wrote:
Wed Aug 29, 2018 8:26 am
Or checks to see if they modified their config file?
No.

phoney
OpenVPN User
Posts: 11
Joined: Wed Aug 29, 2018 8:20 am

Re: Kicking a user off after 30 minutes idle (server side)?

Post by phoney » Wed Aug 29, 2018 2:34 pm

TinCanTech wrote:
Wed Aug 29, 2018 12:26 pm
phoney wrote:
Wed Aug 29, 2018 8:26 am
because we get charged for every connection open and people leave their connections open on their laptops
phoney wrote:
Wed Aug 29, 2018 8:26 am
Is there a way on the server side, that kicks the user off after 30 minutes?
Try using --inactive 900 in the server config ..
phoney wrote:
Wed Aug 29, 2018 8:26 am
Or checks to see if they modified their config file?
No.
I tried putting inactive 900 in /etc/openvpn/server.conf but to no avail - is that correct? I put it at the bottom of the .conf file and restart MySQL connected on a new PC and waited.

Also, if I do the inactive 900 on the client side, I don't need the 4 other lines in my CLIENT conf file (the lines mentioned in my original post)

Thanks for the response too!

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 5015
Joined: Fri Jun 03, 2016 1:17 pm

Re: Kicking a user off after 30 minutes idle (server side)?

Post by TinCanTech » Wed Aug 29, 2018 2:46 pm

phoney wrote:
Wed Aug 29, 2018 2:34 pm
I tried putting inactive 900 in /etc/openvpn/server.conf but to no avail - is that correct?
phoney wrote:
Wed Aug 29, 2018 2:34 pm
I put it at the bottom of the .conf file and restart MySQL connected on a new PC and waited.
Restart you openvpn server ....

Please see:
HOWTO: Request Help !

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 5015
Joined: Fri Jun 03, 2016 1:17 pm

Re: Kicking a user off after 30 minutes idle (server side)?

Post by TinCanTech » Wed Aug 29, 2018 6:37 pm

TinCanTech wrote:
Wed Aug 29, 2018 12:26 pm
phoney wrote:
Wed Aug 29, 2018 8:26 am
Or checks to see if they modified their config file?
No.
In fact, you can push --inactive, which is almost what you need but the client can filter that out.

So, this
TinCanTech wrote:
Wed Aug 29, 2018 12:26 pm
phoney wrote:
Wed Aug 29, 2018 8:26 am
Is there a way on the server side, that kicks the user off after 30 minutes?
Try using --inactive 900 in the server config ..
is still the only way sure way.

phoney
OpenVPN User
Posts: 11
Joined: Wed Aug 29, 2018 8:20 am

Re: Kicking a user off after 30 minutes idle (server side)?

Post by phoney » Wed Aug 29, 2018 6:42 pm

TinCanTech wrote:
Wed Aug 29, 2018 2:46 pm
phoney wrote:
Wed Aug 29, 2018 2:34 pm
I tried putting inactive 900 in /etc/openvpn/server.conf but to no avail - is that correct?
phoney wrote:
Wed Aug 29, 2018 2:34 pm
I put it at the bottom of the .conf file and restart MySQL connected on a new PC and waited.
Restart you openvpn server ....

Please see:
HOWTO: Request Help !
Sorry, I meant restart my OpenVPN server.. not MySQL lol


I will include inactive 900 in the server.conf file and remove the other stuff from the client config file (being those 4 lines in my original post).

Thank you very much. It wont reconnect automatically will it?

phoney
OpenVPN User
Posts: 11
Joined: Wed Aug 29, 2018 8:20 am

Re: Kicking a user off after 30 minutes idle (server side)?

Post by phoney » Mon Oct 08, 2018 8:55 pm

TinCanTech wrote:
Wed Aug 29, 2018 12:26 pm
phoney wrote:
Wed Aug 29, 2018 8:26 am
because we get charged for every connection open and people leave their connections open on their laptops
phoney wrote:
Wed Aug 29, 2018 8:26 am
Is there a way on the server side, that kicks the user off after 30 minutes?
Try using --inactive 900 in the server config ..
phoney wrote:
Wed Aug 29, 2018 8:26 am
Or checks to see if they modified their config file?
No.
viewtopic.php?f=4&t=27216&p=81692#p81692

Can you help at all with that? Been stuck for weeks. Thanks :)

Post Reply