Operating System - HP-UX
1838263 Members
3619 Online
110125 Solutions
New Discussion

allow a certain user only access at console

 
SOLVED
Go to solution
Jeroen_D
Regular Advisor

allow a certain user only access at console

Hello,

how can you allow a certain user access to the console and only to the console ?

We use a certain account called rroot. When logging in as rroot, a script is launched. That script contains a lot of sysadmin tasks.

How can I prevent this person to login from the network ?

TIA,
Jeroen.
4 REPLIES 4
Victor BERRIDGE
Honored Contributor

Re: allow a certain user only access at console

Hi,
create an /etc/securetty and customize it to your needs

Good luck
Victor
Sandor Horvath_2
Valued Contributor

Re: allow a certain user only access at console

Hi !

/etc/securetty good for only root user.

Other users:
Edited the (default) profiles, when user use console continue, else exit shell.
use tty command for this.

regards, Saa
If no problem, don't fixed it.
Dan Hetzel
Honored Contributor
Solution

Re: allow a certain user only access at console

Hi Jeroen,

You could add an entry in that user's .profile, checking for the tty.

Like this:

if [ `tty` != /dev/console ]
then
echo "You must log in from console"
exit 1
fi

Best regards,

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Victor BERRIDGE
Honored Contributor

Re: allow a certain user only access at console

Hi,
Sandor and Dan are correct, I thought your rroot was a root alias (uid 0)in which case the securetty would have been enough (since only users with UID 0 can only connect at the console) but then you would have to avoid the user to do an su...
Follow Dan's advice...

Good luck
Victor