Operating System - Linux
1760015 Members
2994 Online
108889 Solutions
New Discussion юеВ

Re: how to login as root, using telnet???

 
SOLVED
Go to solution
Sharfuddin
Frequent Advisor

how to login as root, using telnet???

Hi to All
when I telnet the remote machine running RedHat 8.0, as root, it doesnt allow to connect to as root, and said "login incorrect". why???
what should I have to do so that I can telnet the system as root.
Ok, I telnet the remote system as a normal user, and then I issue "su" command so that i can logon as root, so i write "$ su root" and provide root password, I(root) logon succeesfuly, but whatever command I issue(i m root now) the system says "bash: shutdown: command not found" or "bash: init: command not found", so I want to know that why I cant do any admin work(receiving "command not found"), although I m login as root on the remote machine.

Thanks in anticipation

Regards
Sharf
14 REPLIES 14
sinhass
Regular Advisor

Re: how to login as root, using telnet???

Check /etc/xinetd.d/telnet file.
Mark Grant
Honored Contributor

Re: how to login as root, using telnet???

Have a look at your /etc/passwd file. See if the entry for "root" looks OK.

Then, look at root's .profile and see if PATH is being set to something silly. A common path error is something like "export PATH=/usr/local/bin:PATH" (missing the $ before the second PATH). This will make most applications "Not found".

If you are being given a login message then it isn't an xinetd problem. May want to check that your tty's are in /etc/securetty but that won't cause the problem you get after you su.

check your environment, run "env" and see if there a re any obvious variables not set correctly, $HOME comes to mind.

All in all, to me it looks like there is a bit of a problem with the root account. Either in one of the .profile type files or in /etc/passwd itse├Г┬╕
Never preceed any demonstration with anything more predictive than "watch this"
Olivier Drouin
Trusted Contributor
Solution

Re: how to login as root, using telnet???

Its not a good idea to login directly "root".

For your other problem:

PATH=$PATH:/the/path/to/some/bin
export PATH

OR

su - root
the "-" will load /etc/profile and/or ~/.profile.
Your PATH will be set then...



Martin P.J. Zinser
Honored Contributor

Re: how to login as root, using telnet???

Hello Sharf,

if you really want to login as root you need to
adapt /etc/securetty and add your terminal like

tty1
tty2
....

Having said that, generally it is a better idea to use ssh for this purpose. Try

ssh root@

This will most probably work. You might need to confirm the setup of some keys upon first login.

Greetings, Martin
Stuart Browne
Honored Contributor

Re: how to login as root, using telnet???

Martin has the right thoughts.

The two main ways of allowing the user 'root' to telnet into a machine is to stack the /etc/securetty with pseudo tty's (defeats the purpose), or to modify the /etc/pam.d/telnet, removing the reliance upon the 'secretty' lib.

Generally though, do away with telnet, and just use SSH.

The whole point of not allowing access to root directly is a security measure to stop people from dictionary-hacking the machine remotely.

Even if they break into a user account, they then have to do it again to get any privileges.
One long-haired git at your service...
Mobeen_1
Esteemed Contributor

Re: how to login as root, using telnet???

Sharf,
I don't think its a good idea to allow root login via telnet. Thats the reason why its disabled on your system.

In any case if there is a pressing need for you to do this for variety of reasons know to you, our colleagues have already posted solutions.

I would think telnetting as yourself and then doing a su would be the way to go. Also i would suggest that you think of implementing SSH on your systems, that would make them more secure

Just my thoughts

regards
Mobeen
Sharfuddin
Frequent Advisor

Re: how to login as root, using telnet???

First I want to say THANKS to u all, I really appreciate u peoples
Unfortuately, I have to left my city, so I cant do the work u people suggest.
I'll be in my city Tommorow, then I'll reply again.
Thanx to All
Robert Binkhorst
Trusted Contributor

Re: how to login as root, using telnet???

Hi,

You're using su without the "-" symbol, which sets root's environment for your session.

So, try this command:
su - root

And you will find all your commands.

HTH,

Robert
linux: the choice of a GNU generation
Mobeen_1
Esteemed Contributor

Re: how to login as root, using telnet???

Robert,
I should say you have a good eye for details :-). I did not notice that he was not using '-' with su.

regards
Mobeen