- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How can I restrict user root can only login sy...
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
05-28-2002 11:55 PM
05-28-2002 11:55 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2002 11:57 PM
05-28-2002 11:57 PM
Solutionecho "console" > /etc/securetty
This will only allow root to login on console or someone to log in first as a normal non-root user, then su - root.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2002 11:59 PM
05-28-2002 11:59 PM
Re: How can I restrict user root can only login system using console?
Create a file called /etc/securetty
Add the entry 'console' without the quotes. Save the file. Make sure that the file has these permissions:
# ll /etc/securetty
-r-------- 1 root sys 8 May 3 2001 /etc/securetty
# more /etc/securetty
console
HTH
~Michael~
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2002 12:22 AM
05-29-2002 12:22 AM
Re: How can I restrict user root can only login system using console?
BTW, Can you tell me how can I get relate docs for /etc/securetty file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2002 12:37 AM
05-29-2002 12:37 AM
Re: How can I restrict user root can only login system using console?
In a addition of the securetty file, if you are using dtlogin you will have to deny root in /usr/dt/config/Xstartup and /etc/dt/config/Xstartup :
...
if [ "$LOGNAME" = "root" ]
then exit 1
fi
...
Regards,
Fr??d??ric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2002 02:34 AM
05-29-2002 02:34 AM
Re: How can I restrict user root can only login system using console?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2002 05:15 AM
05-29-2002 05:15 AM
Re: How can I restrict user root can only login system using console?
The reason is that login prefaces each line in /etc/securetty with /dev/ which means a full pathname would look like: /dev//dev/console and this would fail since the name of the console is /dev/console.
What if there are no valid tty names in the file, or perhaps there is nothing in the file? Again, the man page is not clear, but the behavior is: no root logins from *any* device on the system. That includes the console (pretty darn secure, eh?)
Actually, there is a real good reason for this. With a null /etc/securetty file, all root access requires 2 logins and 2 passwords, one set for a normal user and a second set for su. NOTE: always use su -, never su by itself and this goes for all users (ie, su - lp).
Finally, for 11.0 and 11.11, there is an additional level of security rules available which are controlled by (oddly enough) the /etc/default/security file. Read the details in the man page called security (11i) or see the man page at http://docs.hp.com, search for: /etc/default/security.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2002 05:47 AM
05-29-2002 05:47 AM
Re: How can I restrict user root can only login system using console?
The X logins will not get restricted by /etc/securetty file.
I use following in .profile of root to restrict direct root login on console.
##---
user=`logname`;
sulog="/var/adm/sulog"
TTY="`tty | cut -d/ -f3`"
date=`date "+%m/%d %H:%M"`
if [ ${user} = "root" ]
then
if [ ${TTY} != "console" ]
then
echo "
echo "ERR ${date} - ${TTY} ${user}-root" >> ${sulog}
exit
fi
##-----
Thanks.
Prashant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2002 01:53 PM
05-29-2002 01:53 PM
Re: How can I restrict user root can only login system using console?
http://www.bastille-linux.org
(click on "Download BETA w/ HP Support")
If you choose to do so, it will put "console" into securetty, just as suggested by others.
Note also that X logins may allow root to login directly, and Bastille can help you configure this as well.