- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Turn off Direct Login via /etc/profile for privlig...
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
09-07-2005 01:44 AM
09-07-2005 01:44 AM
Just trying to confirm if there's a way to disable direct logins for privliged users like root and also Application users through the use of /etc/profile. If so could you share this with me?
Thanks
-KPS
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 01:48 AM
09-07-2005 01:48 AM
Re: Turn off Direct Login via /etc/profile for privliged users
Code something like this should handle it:
if [ `id -u` -eq 0 ]
then
....echo "direct login as root not allowed"
....exit 1
fi
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 01:54 AM
09-07-2005 01:54 AM
Re: Turn off Direct Login via /etc/profile for privliged users
If the 'etc/securetty' exists and you place the value "console" in it, you can restrict root logins to that device.
The '/etc/defaults/security' file also has some useful optiions for limiting access to root. Have a look at its SU_ROOT_GROUP for instance.
See the manpages for 'login(1)' and 'security(4)' for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 02:05 AM
09-07-2005 02:05 AM
Solutionbillh
jamesf
kens
Then near the top of /etc/profile (ALWAYS after the line: trap "" 1 2 3) add something like this:
for NOTALLOWED in $(cat /etc/disallowed)
do
if [ $LOGNAME = $NOTALLOWED ]
then
echo "\n --- login not allowed ---\"
exit
fi
And that's it. Now anytime billh, jamesf or kens try to login, they are kicked out immediately.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 02:06 AM
09-07-2005 02:06 AM
Re: Turn off Direct Login via /etc/profile for privliged users
I do appreciate your help...
KPS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 02:07 AM
09-07-2005 02:07 AM
Re: Turn off Direct Login via /etc/profile for privliged users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2005 02:11 AM
09-07-2005 02:11 AM
Re: Turn off Direct Login via /etc/profile for privliged users
/etc/securetty List of valid ttys for root login is good or
In /etc/profile
if [ $name = checkname ]
then
echo $name not allowed to login...only su
exit
fi
#end
Note: checkname should be replaced with the name of the user to whom direct login access is denied.
Could also do
for checkname in $(echo "list of logins to exclude")
do
if [ "$LOGNAME" = "$checkname" ]
then
echo $LOGNAME can only be accessed via su - command
exit
fi
done
~
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2007 12:58 AM
09-12-2007 12:58 AM
Re: Turn off Direct Login via /etc/profile for privliged users
Thanks