Operating System - Linux
1824297 Members
4710 Online
109669 Solutions
New Discussion юеВ

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
Steven E. Protter
Exalted Contributor

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

By default, Red Hat Linux has since at least version 7.0 not allowed by default root login from telnet.

The reason is that telnet does user authentication in clear text, which means anybody along the route or with a sniffer can get your root password during authentication.

I have experienced a second root account being set up on my Red Hat 7.3 box(long since upgraded). I can only believe that occurred due to packet sniffing or some other security flaw.

Since then I use telnet on a normal user account to my ISP and then use SSH to log on. openssh is set up on your Red Hat box to allow root login if you installed it at all. Its secure and I recommend it.

I strongly advise against editing /etc/securetty or the other methods of allowing root to log in directly by telnet.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Olivier Drouin
Trusted Contributor

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

some people have problems with long threads, isn't it ?

Olivier Drouin
Trusted Contributor

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

just joking btw ;-)
Sharfuddin
Frequent Advisor

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

Hi to All
Folks, I m much pleased, and thankfull to u all, for the feedbacks.
Sinhass there is nothing wrong in /etc/xinetd.d/telnet
Mark Grant, I worked on you suggestions, and succeed. As per your instruction in /etc/securetty, I add pts/1, pts/2....not ttyx(tty1, tty2...were alredy there), and then try root login via telnet, and login ssuccessfuly. again thanks, for support.
Olivier Drouin , u are indeed Great, yes u were wright, I followed ur instructions, and succeed, thanks, and so nice of u.
Martin P.J. Zinser, u too a Great, as per your instructions I did
#ssh root@node, and succeed. And you told me to check /etc/securetty, I check this file, and found all ttys(tty1, tty2, ...), but have to add pts/x, and it works.
Stuart Browne, I didnt find the /etc/pam.d/telnet file, so I didnt follow u, sorry and thanks.
And in last thanks a lot, Mobeen for u r kind suggestions/thoughts.

Thanks
sharf
Saravanan_9
Advisor

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

hi,

In /etc directory the filename called
securetty. just rename that file . u can login as the root

like

#mv /etc/securetty /etc/securetty.old