Showing results for 
Search instead for 
Do you mean 

root login deny

SOLVED
Go to Solution
Occasional Advisor

root login deny


Hello,

How can I lock the root user login by telnet?
I want that no one does login directly.

Thanks in advance,
Fabricio.
10 REPLIES
Respected Contributor

Re: root login deny

ls -la /etc/securetty

if it does not exist, then

echo console > /etc/securetty
chmod 400 /etc/securetty
chown root:sys /etc/securetty

see manpage for login for more details
Honored Contributor

Re: root login deny

Create a file - /etc/securetty and put the word - console - in it.

This will restrict the root user login. Use root will only able to login from local console.

# man login (for more details)
Life is a promise, fulfill it!
Honored Contributor

Re: root login deny

Hi,
Create a file called securetty in /etc.

echo console >/etc/securetty
chmod 400 /etc/securetty

Now console only allow direct access to root.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Occasional Advisor

Re: root login deny



OK, thanks...

And just one more question: How can I deny the remote login from a common user (not root)?

Thanks again...
Fabricio.
Honored Contributor

Re: root login deny

I fear I dont understand your problem. You can always lock the account of that user.

Or add script in .profile of that user and logoff.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Honored Contributor

Re: root login deny

1) Disable the account by editing passwd file or through SAM.

2) Add 'exit' command on the user $HOME/.profile file
Life is a promise, fulfill it!
Highlighted
Occasional Advisor

Re: root login deny



I don´t want that user "oracle" does login directly because it´s a generic user, I want that other user does a login and than it does a "su" for "oracle". So I can see who was oracle at sulog.

Thanks,
Fabri
Honored Contributor

Re: root login deny

Fabricio,
Simplest way is

echo exit >>~oracle/.profile.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Honored Contributor

Re: root login deny

Occasional Advisor

Re: root login deny


Thanks for everybody...

I used this script at /etc/profile to solve de problem:

NAME=`logname`
if [ $NAME = oracle ]
then
exit
fi