Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: weblance on January 10, 2012, 12:46:36 AM

Title: Time schedule VPN access
Post by: weblance 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
Title: Re: Time schedule VPN access
Post by: weblance on August 20, 2012, 06:19:17 PM
Bump
Title: Re: Time schedule VPN access
Post by: weblance on August 20, 2012, 06:19:57 PM
Has anyone got an answer?
Title: Re: Time schedule VPN access
Post by: johnp 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.
Title: Re: Time schedule VPN access
Post by: weblance 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!
Title: Re: Time schedule VPN access
Post by: Stefano 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
Title: Re: Time schedule VPN access
Post by: janet 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

Title: Re: Time schedule VPN access
Post by: Stefano 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