- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Restricting direct login access to non-root user
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-25-2003 01:36 AM
11-25-2003 01:36 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2003 01:48 AM
11-25-2003 01:48 AM
Re: Restricting direct login access to non-root user
They have to login as themselves and then su - oracle, so we have a audit trail.
We do this by putting the following lines into /etc/profile:
trap "" 1 2 3
who -m >/dev/null 2>&1
if [ "$?" = "0" ]
then
TSTUSR=`who -m | cut -f1 -d" " | cut -c1-6`
if [ "$TSTUSR" = "oracle" ]
then
echo -------------------------------------
echo STOP! Do not logon directly as oracle
echo Do an SU in future please
echo -------------------------------------
exit
fi
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2003 01:51 AM
11-25-2003 01:51 AM
Re: Restricting direct login access to non-root user
export USER=`whoami`
grep -q "$USER" /etc/spec.users
if [ "$?" -eq 0 ]
then
if [ "$Owner" = "$USER" ]
then
echo "$USER user is not allowed to log in directly"
sleep 5
/usr/bin/kill -9 0
fi
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2003 01:53 AM
11-25-2003 01:53 AM
Solutionthere is an old trick: make use of the korn shell's logname, e.g. insert in the beginning of .profile:
#!/usr/bin/sh
if [ `logname` = "oracle" ]
then
echo "direct login not allowed"
exit
fi
this will make direct login impossible for the oracle user.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2003 01:54 AM
11-25-2003 01:54 AM
Re: Restricting direct login access to non-root user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2003 01:57 AM
11-25-2003 01:57 AM
Re: Restricting direct login access to non-root user
trap "" 1 2 3
login_id=`logname`
if [ $login_id = "oracle cccount"]
then
echo "No direct logins allowed, use user login and do su to oracle"
exit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2003 02:42 AM
11-25-2003 02:42 AM
Re: Restricting direct login access to non-root user
Have the user execute a script login_oracle. This script sets the oracle ID's password to a known password it also has the setuid bit set so that the script can be run as though the user is root. At the same time it sets the oracle password, it does an su to oracle, does a typescript, and when exited, e-mails root with the typescript file.
Along the way you will need to do several little things such as setting ignore break so the DBA can't actually get beyond the typescript.
Tim
When oracle_userID isn't active. the password field has an asterisk in it(no login).
Then to activate the account set the known password.
We have a security officer who builds the accounts and who can activate special users/vendors in this manner
Hope that is a help.
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2004 02:55 PM
04-12-2004 02:55 PM
Re: Restricting direct login access to non-root user
#!/bin/csh -f
set login_id=`logname`
if ($login_id == 'sybase') then
echo "No direct logins allowed. Use [su - sybase] instead"
set pid = `ps | grep "csh" | sed 's/^ *//' | cut -f1 -d" "`
kill -9 $pid
endif