Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabe ability to Telnet in using Root

Status
Not open for further replies.

agape234

Programmer
Oct 10, 2001
128
US
What file do I need to edit to remove the ability to telnet in using the root account?
What is the process for enabling ssh and disabling telnet?
 
I would remove all telnet access to the box. To do that edit your services file in /etc and initd.conf (that is also where you would add your ssh). Before you disable telnet make sure you have ssh set to start on boot. You should find the file to edit for start up in /etc/rc3.d. My file is S89sshd. Edit it to fit your install of ssh. Reboot the system to make sure ssh starts. Once you have that done remove telnet access. Have clients use Putty, it is a free client that can do ssh.
 
Hi,

a remark about ssh and inetd:

you don't have to start sshd over inetd (if you want to do so you have to add a line in /etc/inetd.conf:

ssh stream tcp nowait root /usr/local/bin/sshd sshd -i

and the following in /etc/services:

ssh 22/tcp # SSH Remote Login Protocol

Generally this is not a good idea because at every login the server creates a new server key which takes some time!)

Therefore I would do the following steps:

Install the ssh Package (for example openssh from or the commercial software from Then disable the telnet entry by editing the file /etc/inetd.conf (put a # in front of the following line):

telnet stream tcp6 nowait root /usr/sbin/in.telnetd in.telnetd

Then execute the command:

# kill -HUP PID_of_inetd

Put an appropriate start script in /etc/init.d and put a soft link from /etc/rc2.d to your start script, so that the ssh daemon will automatically come up when you have to boot your machine:

# ln -s /etc/init.d/sshd /etc/rc2.d/S99sshd

Hope that is helpful.

mrjazz [pc2]
 
To prevent root from logging in, except on the console, remove the comment from the following line in /etc/default/login:
[tt]
#CONSOLE=/dev/console
[/tt] Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top