LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-11-2010, 04:29 AM   #1
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 707

Rep: Reputation: 55
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 ?
 
Old 03-11-2010, 04:37 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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.
 
Old 03-11-2010, 04:58 AM   #3
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 707

Original Poster
Rep: Reputation: 55
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 ?
 
Old 03-11-2010, 05:11 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Time skew of 580 min when I set my time zone in Gentoo scooter2 Linux - Newbie 1 03-05-2009 10:27 AM
RHEL unable to set a user's ulimit (openfile) murali23.unix Linux - Newbie 1 07-28-2008 10:05 PM
Where does RH8 daily set system time to hardware clock time smartnorman Red Hat 1 05-24-2006 02:42 PM
Cannot set time/date to other time zone than UTC (Kubuntu) jamangold Ubuntu 1 12-23-2005 05:42 PM
Doub about `net time set` and daylight saving time Thakowbbery Linux - Software 0 10-17-2005 05:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration