Operating System - HP-UX
1829962 Members
2173 Online
109998 Solutions
New Discussion

How can I prevent user to login directly to a generic account?

 
SOLVED
Go to solution
Joachim Weber_1
Advisor

How can I prevent user to login directly to a generic account?

Hi,

I'm trying to secure access to a non-root generic user. Users should only be able to su to this generic user from their user specific logins. A direct login should not be possible.

Maybe someone knows a solution.


Thanks in advance,

Joachim
7 REPLIES 7
Cheryl Griffin
Honored Contributor
Solution

Re: How can I prevent user to login directly to a generic account?

Robert-Jan Goossens
Honored Contributor

Re: How can I prevent user to login directly to a generic account?

Sanjay Kumar Suri
Honored Contributor

Re: How can I prevent user to login directly to a generic account?

If you are using CDE you can add the following kind of code in /etc/dt/config/Xstartp file and save.

if [ "$USER" = "root" ]; then
if [ -f /etc/securetty ]; then
if [ "$DTXSERVERLOCATION" != "local" ]; then
grep -q console /etc/securetty
if [ `echo $?` -eq 0 ]; then
exit 1
fi
fi
fi
fi

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Joachim Weber_1
Advisor

Re: How can I prevent user to login directly to a generic account?

Hi,

Cheryl, that was so quick and the link really did it. Thanks very much!!

Robert-Jan, a bit more complicated but surely an option.

Sanjay, a good way to secure root.

Thanks to all of you for the quick response!!!!

Regards,

Joachim
Mark Grant
Honored Contributor

Re: How can I prevent user to login directly to a generic account?

I was going to post this but thought it a bit silly. However, HP seem to suggest you do something silly too :)

How about this in the .profile, it's a bit shorter

[ $0 != "-su" ] && exit
Never preceed any demonstration with anything more predictive than "watch this"
Joachim Weber_1
Advisor

Re: How can I prevent user to login directly to a generic account?

Hi Mark,

That seems to be as short as it can get :)

Great idea!!!

Thanks,

Joachim
Paul F. Carlson
Valued Contributor

Re: How can I prevent user to login directly to a generic account?

I'm a couple days late on a reponse here, but have you thought of using sudo?

Change the password on the account to an unknown value to the user, then require them to use sudo to su to that account.
Link down -- cable problem?