HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Applicationuser direct-login restricions....
Operating System - HP-UX
1834934
Members
2763
Online
110071
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
09-08-2003 05:10 AM
09-08-2003 05:10 AM
Applicationuser direct-login restricions....
Hi
I made a small script in denying users direct login...
I'm placing at the end of /etc/profile.
I created the file /etc/user_deny and chmod'ed it to 544.
I also created the logfile /var/adm/unautorized_directlogin.log
and chmod'ed it to 522
----------------
#This script is supposed to deny given users access to direct login. (not root)
JEG=$(whoami)
if pwget -n "$JEG" | awk -F: '{exit ($3 == 0)}'; then
for US in $(cat /etc/usr_deny)
do
#Are u a part of /etc/user_deny?
if [ $JEG = $US ] ; then
# yes. Do u come by su -?
PRO=$(ps -f | awk '{print $8}'| grep su)
#yes
if [ "$PRO" != "-su" ] ; then
#If not - bye bye
echo "[$(date)] $JEG direct-login attempt - access denied" >>/var/adm/unautorized_directlogin.log
exit
fi
fi
done
fi
-----------------------
The content of /etc/user_deny
-----------------------
#more /etc/usr_deny
test1
test2
test3
------------------------
Sadly about this script it does not deny bash users...
Is there a better way of doing this?
Is accually works, but only for /usr/bin/sh users.
-Paul
I made a small script in denying users direct login...
I'm placing at the end of /etc/profile.
I created the file /etc/user_deny and chmod'ed it to 544.
I also created the logfile /var/adm/unautorized_directlogin.log
and chmod'ed it to 522
----------------
#This script is supposed to deny given users access to direct login. (not root)
JEG=$(whoami)
if pwget -n "$JEG" | awk -F: '{exit ($3 == 0)}'; then
for US in $(cat /etc/usr_deny)
do
#Are u a part of /etc/user_deny?
if [ $JEG = $US ] ; then
# yes. Do u come by su -?
PRO=$(ps -f | awk '{print $8}'| grep su)
#yes
if [ "$PRO" != "-su" ] ; then
#If not - bye bye
echo "[$(date)] $JEG direct-login attempt - access denied" >>/var/adm/unautorized_directlogin.log
exit
fi
fi
done
fi
-----------------------
The content of /etc/user_deny
-----------------------
#more /etc/usr_deny
test1
test2
test3
------------------------
Sadly about this script it does not deny bash users...
Is there a better way of doing this?
Is accually works, but only for /usr/bin/sh users.
-Paul
"sendmail is kind of fun..."
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2003 05:20 AM
09-08-2003 05:20 AM
Re: Applicationuser direct-login restricions....
Hi Paul,
Take a look at next link.
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x7924cbaac6dcd5118ff40090279cd0f9,00.html
Regards,
Robert-Jan.
Take a look at next link.
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x7924cbaac6dcd5118ff40090279cd0f9,00.html
Regards,
Robert-Jan.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP