- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to restrict concurrent user login?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 04:07 PM
01-15-2003 04:07 PM
I'm trying to restrict users from logging in more than one or two concurrent sessions. How can I do that? Someone told me to go to /etc/default/security, but I don't find security in /etc/default. Please help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 04:29 PM
01-15-2003 04:29 PM
Re: How to restrict concurrent user login?
You can do this, from SAM if your system is trusted.
Or create a file
/etc/default/security with root as owner and 644 permission.
Add a line
NUMBER_OF_LOGINS_ALLOWED=1
This feature will work in 11.x.
But I am not sure, whether this works in 10.20.
Srini.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 04:31 PM
01-15-2003 04:31 PM
SolutionI'd edit /etc/profile and throw something like:
LOGIN_NUMBER=`who | grep $LOGNAME | wc -l`
if [ $LOGIN_NUMBER -gt 1 ]
then
echo "You already have an open session.
If this is not the case, please notify the Sys Admin."
sleep 7
exit
fi
I tested this on a 10.20, and my shell is /usr/bin/ksh.
For testing this suggestion as well as any others that people may give, I would make sure to be logged into the server as root from a session. Messing with login restrictions can be dangerious so you want make sure you already have an established connection before doing so!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 04:31 PM
01-15-2003 04:31 PM
Re: How to restrict concurrent user login?
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x431472106351d5118fef0090279cd0f9,00.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 04:33 PM
01-15-2003 04:33 PM
Re: How to restrict concurrent user login?
On 10.20 is a hard task, on 11.0 you onlys need define in /etc/default/security file:
NUMBER_OF_LOGINS_ALLOWED=3 (must be in caps)
This apply for no-root users (su excluded)
And certify that PHCO_27721 patch is installed.
Other ways could be include in /etc/profile file followings lines:
MAX=3
CURRENT=`who|grep $LOGNAME|wc -l`
if [ $CURRENT -gt $MAX ]
then
exit
fi
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 04:34 PM
01-15-2003 04:34 PM
Re: How to restrict concurrent user login?
Or there is a module in PAM called as session management that allows this configuration.
Try going through this document which might give you some idea as how to go
http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000062952847
Cheers
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 04:35 PM
01-15-2003 04:35 PM
Re: How to restrict concurrent user login?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 04:36 PM
01-15-2003 04:36 PM
Re: How to restrict concurrent user login?
You can follow Ian's idea. Just put one more check at the beginning of the script to allow you to have multiple sessions.
if [ "$LOGNAME" != "your_login" ]
then
Ian's code
fi
This way you can login with any number of attempts.
The corresponding file for csh would be /etc/csh.login. You need to modify the script a bit to suit to csh.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 04:36 PM
01-15-2003 04:36 PM
Re: How to restrict concurrent user login?
I haven't tried that on 10.20.
by the way - Harry,
if you assign points
then please don't assign any to this second entry!
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 04:45 PM
01-15-2003 04:45 PM
Re: How to restrict concurrent user login?
A trusted system is HP-UX with additional security enhancements.
The world-readable /etc/passwd file no longer has encrypted passwds in it instead, the encrypted passwords are stored in /tcb, which can only by accessed by root.
you also can enable auditing and additional password security functionality.
the decision to convert to a trusted system should not be taken lightly. On a 10.20, you'd want to make sure that you have the latest patches before even considering to convert. Doing a little digging in the ITRC forums will uncover a lot of horror stories regarding people who converted without enough preparation/backout plans
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 05:05 PM
01-15-2003 05:05 PM
Re: How to restrict concurrent user login?
Note that restricting users to a small number of sessions doesn't help performance since a single session could consume all CPU and memory. Perhaps the users are running Xwindows and starting xterms or dtterms on your system? Consider using a local telnet client rather than xterm/dtterm/hpterm.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 05:12 PM
01-15-2003 05:12 PM
Re: How to restrict concurrent user login?
#! /usr/bin/sh
checkuproc () {
termtty=$(/usr/bin/who -Rm |/usr/bin/awk '{print $2}')
num_u_proc=$(($(/usr/bin/ps |/usr/bin/grep "$termtty"|/usr/bin/grep $mproc|/usr/bin/wc -l)))
if [ ${num_u_proc} -gt 1 ]; then
print "Error: There is already a session running."
session=1
fi
}
# main
session=0
checkuproc
if [ $session -ne 0 ]; then
exit
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 05:14 PM
01-15-2003 05:14 PM
Re: How to restrict concurrent user login?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 05:21 PM
01-15-2003 05:21 PM
Re: How to restrict concurrent user login?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2003 05:23 PM
01-15-2003 05:23 PM
Re: How to restrict concurrent user login?
For the differences check the following link.
http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000065676950
I'v cut & pasted some points here
The following information lists the MAJOR differences between trusted
and non-trusted systems:
1. A trusted system allows system auditing to be turned on.
System auditing enables the ability to trace every system call
issued by each user on the system. Non-trusted systems run
with system auditing disabled.
2. Trusted systems have improved password management.
Below is a list of password management features:
a. Specification of a grace period and expiration period for
passwords.
b. The ability to specify system-wide password aging.
c. The ability to specify an absolute account life.
d. The ability to disable accounts after repeated login
failures.
e. Passwords lengths of up to forty (40) characters.
f. The ability to access a random password generator.
3. Trusted systems have additional login restrictions, while
non-trusted systems do not. Below are the features of
trusted system login restrictions:
a. In addition to account disabling, the account may also be
locked.
b. Setting accounts to be accessed only at certain times of
the day.
c. The ability to specify account location access. In other
words, account access at specific devices, workstations,
and so on.
d. The ability to specify a single-user boot password.
Note: These login restrictions are NOT available on
NON-TRUSTED systems.
4. A trusted system has shadowed passwords, while a non-trusted
system does not have shadowed passwords. Shadowed passwords
are kept in locations other than /etc/passwd. This prevents
users from viewing the /etc/passwd file and determining which
accounts do not have passwords. This also prevents hackers from
running "password cracker programs" against passwords in the
/etc/passwd file.
For more information, please refer to the following document:
"Administering Your HP-UX Trusted System"
Srini
SYD-IT.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2003 02:44 AM
01-16-2003 02:44 AM
Re: How to restrict concurrent user login?
Don't you think they helped you out a lot ?
You'dd better give them some points for their answers. They will be helping you twice as fast next time :)
Regs David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2003 09:23 AM
01-16-2003 09:23 AM
Re: How to restrict concurrent user login?
Also, thanks to everybody here. Your responds are so fast and I really appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2003 09:32 AM
01-16-2003 09:32 AM
Re: How to restrict concurrent user login?
Best regards,
Harry
- newbie to UNIX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2003 04:15 PM
01-16-2003 04:15 PM
Re: How to restrict concurrent user login?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2003 04:40 PM
01-16-2003 04:40 PM
Re: How to restrict concurrent user login?
Sorry about the delay in responding - when I saw the "magic rabbit" by your thread, I made the assumption that the thread was complete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2003 03:55 PM
01-17-2003 03:55 PM
Re: How to restrict concurrent user login?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2003 04:13 PM
01-17-2003 04:13 PM
Re: How to restrict concurrent user login?
if [ "$LOGNAME" != "your_login" -o "$LOGNAME" != "your_bosses_login" ]
then
{the code I gave you near the top}
fi
this can be put into /etc/profile also. It could get cumbersome if the list of users you want to exclude is large. How many users do you want to allow multiple connections to the server?