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
-
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
-
Bump
-
Has anyone got an answer?
-
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 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!
-
no need to be a developer..
search the forums for crontab and the db/signal-event commands
search the wiki too
-
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
-
Put these commands into a file eg VPNon.sh
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