Koozali.org: home of the SME Server

Time schedule VPN access

Offline weblance

  • ****
  • 95
  • +0/-0
Time schedule VPN access
« on: January 10, 2012, 12:46:36 AM »
Hi,

I have some users on the SME that have VPN access, but I want to be able to restrict the time of day, when these users are allowed to access the server through VPN. Is it possible to have some kind of time schedule for the VPN?

Regards,

Carl

Offline weblance

  • ****
  • 95
  • +0/-0
Re: Time schedule VPN access
« Reply #1 on: August 20, 2012, 06:19:17 PM »
Bump

Offline weblance

  • ****
  • 95
  • +0/-0
Re: Time schedule VPN access
« Reply #2 on: August 20, 2012, 06:19:57 PM »
Has anyone got an answer?

Offline johnp

  • *****
  • 312
  • +0/-0
Re: Time schedule VPN access
« Reply #3 on: August 20, 2012, 09:03:49 PM »
I would think that cron running a startup and shutdown script that changes the account db VPNClientAccess key for the users in question and a signal-event remoteaccess-update would do what you want.

Offline weblance

  • ****
  • 95
  • +0/-0
Re: Time schedule VPN access
« Reply #4 on: August 21, 2012, 10:46:08 PM »
I would think that cron running a startup and shutdown script that changes the account db VPNClientAccess key for the users in question and a signal-event remoteaccess-update would do what you want.

I'm far from a developer. Can you please provide me with the specific commands? Thanks!

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Time schedule VPN access
« Reply #5 on: August 22, 2012, 01:58:25 AM »
no need to be a developer..
search the forums for crontab and the db/signal-event commands
search the wiki too

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Time schedule VPN access
« Reply #6 on: August 22, 2012, 12:28:33 PM »
weblance

Here's some clues & suggestions

To view the settings for a user
db accounts show username
(replace username with the obvious)

Put these commands into a file eg VPNon.sh
db accounts setprop username VPNClientAccess yes
signal-event user-modify username

Put these commands into a file eg VPNoff.sh
db accounts setprop username VPNClientAccess no
signal-event user-modify username

Then create cron jobs to run at certain times to run each script, remember to give executable permissions to the files.
Search here for cron jobs, there is also a cron job contrib, or refer to this specific example for another purpose. Just copy the methodology
http://wiki.contribs.org/Backup_with_dar#Backup_disk_size_limits_workaround

Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Time schedule VPN access
« Reply #7 on: August 22, 2012, 12:59:17 PM »
Put these commands into a file eg VPNon.sh
Code: [Select]
db accounts setprop username VPNClientAccess yes
signal-event user-modify username

I would use the full path to db command because cron's environmental variables could be different
my 2c