- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: limit logins to members of a specific group
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
11-18-2003 08:27 AM
11-18-2003 08:27 AM
limit logins to members of a specific group
HPUX 11.00 on L2000 hardware.
I seem to be an early case for dementia...
How can I limit logins to a system by group membership? Only those users that are a member of the sysadmin group can login, everybody else is prevented from login to the system.
Many thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 08:29 AM
11-18-2003 08:29 AM
Re: limit logins to members of a specific group
One way to do it might be to put some code in /etc/profile to check the valid group and exit otherwise.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 08:47 AM
11-18-2003 08:47 AM
Re: limit logins to members of a specific group
BTW: I didn't know you suffered from dementia ... ;^) (Must be that rocky mountain air)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 09:06 AM
11-18-2003 09:06 AM
Re: limit logins to members of a specific group
I had a look around and couldn't find an exact example of allowing just certain groups, but the below posting has some on actual users and multiple users.
http://forums1.itrc.hp.com/service/forums/parseCurl.do?CURL=%2Fcm%2FQuestionAnswer%2F1%2C%2C0x431472106351d5118fef0090279cd0f9%2C00.html&admit=716493758+1069192693577+28353475
Cheers
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 09:28 AM
11-18-2003 09:28 AM
Re: limit logins to members of a specific group
Anyway, I looked at the who command it provides nothing.
Here is how I'd do the hack.
I'd use awk -F to get the group number from the /etc/passwd file. I think its the forth field. $4
Put it in a variable.
Then decision making based on what I get back.
if [ $GROUP -eq 200 ] then
echo "You are not authorized for log in."
echo "You have been a very naughty user."
exit 1
fi
I'll work on the awk command and if I get it, I'll post it up.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 09:45 AM
11-18-2003 09:45 AM
Re: limit logins to members of a specific group
It assumes $LOGNAME variable is set.
tfile=/tmp/$$.dat
grep -i $LOGNAME /etc/passwd > $tfile
for grp in `awk '{ FS=":"; print $4 }' $tfile`
do
# $user=`awk '{ FS=","; print $1 }' $userstring`
# passwd -r file -n $MINDAYS -x $MAXDAYS $user
echo "$grp"
# passwd -f $user
# passwd -x 48 $user
# /usr/lbin/modprpw -l -k $user
# useradd -m $user
# echo "Command2: passwd -f $user "
done
rm $tfile
That gets you the group id, which was much harder than I thought it would be to get. This only gets the primary group though.
Combined with the last post, thats how I'd do it. I'm also quite glad I DON'T have to do such things. This one gave me a headache.
I'm going home now to watch my kids. I sense another headache coming on.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com