LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ulimit to set the time of login (https://www.linuxquestions.org/questions/linux-newbie-8/ulimit-to-set-the-time-of-login-794655/)

vinaytp 03-11-2010 04:29 AM

ulimit to set the time of login
 
Dear All,

Is it possible to set a user to login only during 3rd week of every month using ulimit ?

I searched in man page of ulimit. Turned out with no luck.

If its not possible by ulimit, is there any other way to accomplish this ?

druuna 03-11-2010 04:37 AM

Hi,

I don't think this can be done with ulimit.

You don't mention the distro you need this for, but take a look here: Limit users access to Linux in a time range

Hope this helps.

vinaytp 03-11-2010 04:58 AM

Thanks drunna,

I am trying to achieve this functionality on Fedoar11.

I read the times.conf file, wherein we cannot specify Day of the month i.e., 1st week, 2nd week etc.

times.conf file only specifies on which day of the week access can be granted/revoked.

Is there any other way to block a specific user on 3rd week of the month ?

druuna 03-11-2010 05:11 AM

Hi,

Your first and third post contradict each other:

set a user to login only during 3rd week of every month

vs

Is there any other way to block a specific user on 3rd week of the month

Another way of disabling/enabling an account is to lock the account (passwd -i <user>) and unlock (passwd -u <user>) it when you need it. You probably need to write 2 simple scripts (one to lock and one to unlock) and let crontab take care of the rest. I'm not sure which crontab is installed on fedora, but most should be able to handle your request (do something in third week of the month).

Hope this helps.


All times are GMT -5. The time now is 05:42 PM.