Computing.Net > Forums > Linux > Limiting user logins

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Limiting user logins

Reply to Message Icon

Name: YoYo
Date: May 29, 2005 at 14:47:04 Pacific
OS: SuSE 9.0
CPU/Ram: Pentium 266
Comment:

Hi,

I'm running suse 9.0 on an old pentium as a internet proxy, and users connect remotely to start/stop the dialup connection using PuTTY (a nice program)
Does anyone know how I can "limit" the time that users can logon, and possibly log them out automatically, say between 5pm and 11pm
- basically a time-restriction on logins but not a idle use timeout.
I'm sure you could do this on windows NT4 so you MUST be able to do it in linux :)

Thanks for your help



Sponsored Link
Ads by Google

Response Number 1
Name: Wolfbone
Date: May 29, 2005 at 16:19:55 Pacific
Reply:

Using the information in /var/log/wtmp ('man last'), write a cron job to periodically check if anyone's logged in too long and kick them off. You'd need to prevent them logging back in immediately with 'passwd -l' and make sure to use 'passwd -u' at some later time.

You can use 'passwd -l' and 'passwd -u' to deny logins between certain times of day using a separate cron job.


0

Response Number 2
Name: 3Dave
Date: May 31, 2005 at 08:25:27 Pacific
Reply:

If you want to stop everybody (except for root) logging in between specific times, write a cron job that creates a file called /etc/nologin and then another cron job that removes the file at a specific time. The text contents of that file is displayed when a user tried to login (eg Logins on this server are restricted to office hours blah blah...), if the file is empty it just displays "login incorrect" which can sometimes confuse users. NB I think FTP users are still able to login with that file present.


0

Response Number 3
Name: YoYo
Date: June 6, 2005 at 13:50:35 Pacific
Reply:

Thanks you guys for taking the time to reply

I am reading the man pages on passwd & cron to try and understand how to use the commands, and will attempt a solution using your advice.

Cheers

YoYo


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Limiting user logins

Limiting users to specific directories. www.computing.net/answers/linux/limiting-users-to-specific-directories/12026.html

User login problem www.computing.net/answers/linux/user-login-problem/9644.html

User login Red Hat need help... www.computing.net/answers/linux/user-login-red-hat-need-help/18805.html