LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to restrict a single user logon (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-restrict-a-single-user-logon-813039/)

MichaelWalsh 06-09-2010 12:51 AM

How to restrict a single user logon
 
Hi,

Can anybody please tell me how can i restrict a single particular user from logging into the server not more than 5 times?

The conditions may be:
1) wrong password
2) can login only 5 times on one day etc.


Thanks in advance

Drakeo 06-09-2010 01:20 AM

The /etc/rc.d/rc.K handles the single user logon
well I use a bios password that way you need a password to boot the hardware.
I am sure some one has a script out there.
cough it up programmers
Check out your /etc/rc.d/rc.K script and then you can tweek what you need.

tracertong 06-09-2010 10:36 AM

OP is not asking about booting to Single User mode, but how to restrict the access of a single user (i.e. one of many).

This may be available in a given distribution, but it isn't something that is directly supported at the operating system level of Linux, as such - so if it's not there already, it's going to be a job of actually writing something, I think.

You don't name the distribution you are running, nor whether this is a command-line login, or a login to a graphical desktop, or whatever... Comandline login process is handled by a program called 'tty' or 'getty' (stands for 'get teletype', from the dim and distant past of computing, for what it's worth). You may want to consider putting something in that intercepts the login process after getty has dealt with basic user-authentication - something that logs the user back out again, if they fail the additional criteria you have set for them, for instance.

Either way, its an additional layer of user management as far as I can see. For one thing, this is going to need some form of database, to keep count of number of logins per day and number of fluffed logins, et cetera.

DaveQB 06-09-2010 08:58 PM

Policy Kit MAY help here. I haven't read up in it.

http://en.wikipedia.org/wiki/PolicyKit

HTH

frndrfoe 06-09-2010 09:58 PM

If you use pam you can use pam_tally
If you use LDAP you can use ppolicy

MichaelWalsh 06-09-2010 11:43 PM

Thank you all for your valuable suggestions..


All times are GMT -5. The time now is 08:20 PM.