Operating System - HP-UX
1834554 Members
3967 Online
110069 Solutions
New Discussion

Restricting the number of user logons

 
Tim Wescott_3
Advisor

Restricting the number of user logons

Hello

Is it possible to restrict the number of times a user logs in to HP-UX 11i so they can only have, say, two concurrent logins?

If so, can this be done globally for all users or is it an individual setting?

Thanks
Tim
10 REPLIES 10
Pete Randall
Outstanding Contributor

Re: Restricting the number of user logons

Tim,

Depending on the shell they use (sh or ksh), they probably use /etc/profile. You can easily insert code in /etc/profile to check the number of logins they already have and reject them if excessive.


Pete

Pete
Peter Godron
Honored Contributor

Re: Restricting the number of user logons

Tim,
you could also try:
Add into
/etc/default/security file

NUMBER_OF_LOGINS_ALLOWED=2
Regards
T G Manikandan
Honored Contributor

Re: Restricting the number of user logons

you can do this globally using the entry in the /etc/default/security file for the parameter
NUMBER_OF_LOGINS_ALLOWED

if you are using ssh then,
change "UseLogin yes" in the /opt/ssh/etc/sshd_config with the following patch installed,
PHCO_27694
Muthukumar_5
Honored Contributor

Re: Restricting the number of user logons

You can get users logged count with who -u . Control with scripting in /etc/profile file. And this will not work for x-windows users.

Easy to suggest when don't know about the problem!
Naveej.K.A
Honored Contributor

Re: Restricting the number of user logons

Mani/Peter,

I have a question, does this work even if the system is not configured to be trusted??

Regards,
Naveej
practice makes a man perfect!!!
Deepak Kulkarni
Regular Advisor

Re: Restricting the number of user logons

Hi Tim

man secutiry. You have got the answer.

Cheers
D K
Pete Randall
Outstanding Contributor

Re: Restricting the number of user logons

Naveej,

Yes, the /etc/default/security setting, NUMBER_OF_LOGINS_ALLOWED works on non-trusted systems. See the man page for security. The parameters that require the system to be trusted are clearly identified.


Pete

Pete
Tim Wescott_3
Advisor

Re: Restricting the number of user logons

Hello

Thanks for all the quick and good advice.

The /etc/default/security file does not exist. Is it a case of creating a blank one with only the suggested line to limit logons!?

Thanks again
Tim
T G Manikandan
Honored Contributor

Re: Restricting the number of user logons

yes,create one and include the parameter

If the file is not present it points to the default behaviour.
Peter Godron
Honored Contributor

Re: Restricting the number of user logons

Tim,
having a /etc/default/security allows you to configure your security more flexible.
So as previously mentioned the addition of the NUMBER_OF_LOGINS_ALLOWED allows you to control access systemwide , without extra coding.
Regards