Operating System - HP-UX
1831580 Members
3676 Online
110025 Solutions
New Discussion

How to restrict root login via dtlogin

 
SOLVED
Go to solution
Marshmellow
Advisor

How to restrict root login via dtlogin

Reflection X is used to access CDE although we don't have many non-root users using this. I browse ITRC and picked up this code to add to the /usr/dt/config/Xstartup file:-

if [ "$LOGNAME"="root" ]
then exit 1
fi

But now no users can use CDE which is not the desired result. Grateful for any tips.
7 REPLIES 7
Dennis Handly
Acclaimed Contributor

Re: How to restrict root login via dtlogin

You are probably missing some spaces:
if [ "$LOGNAME" = "root" ]; then
exit 1
fi
Robert-Jan Goossens_1
Honored Contributor

Re: How to restrict root login via dtlogin

Hi,

Why not restrict all direct root logins excluding the root login from the console?

# echo "console" > /etc/securetty

You can always use su - to get root access.

Regards,
Robert-Jan
Marshmellow
Advisor

Re: How to restrict root login via dtlogin

Thank you for the last two replies but when I used the [], yes, other non-root users can login but so can root. That's not what I want though.

As for securetty, it doesn't restrict root login via X which uses dtlogin.

Robert-Jan Goossens_1
Honored Contributor
Solution

Re: How to restrict root login via dtlogin

Title: HP-UX 11i Graphics and Graphical Interfaces - How to Disable Root Access in x-windows
Document ID: emr_na-c01286682-1

http://www12.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=emr_na-c01286682-1

Marshmellow
Advisor

Re: How to restrict root login via dtlogin

thanks for all your replies... will check out shortly as first day in office after Xmas vacation.
Marshmellow
Advisor

Re: How to restrict root login via dtlogin

Points assigned. Many thanks for the speedy response as always.
Marshmellow
Advisor

Re: How to restrict root login via dtlogin

Title: HP-UX 11i Graphics and Graphical Interfaces - How to Disable Root Access in x-windows
Document ID: emr_na-c01286682-1

as advised by Robert-Jan Goossens