Discussion Locked

how to disable telnet on RH 7.1

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have diabled telnet in /etc/xinetd.d, I have run chkconfig and turned off telnet from all run levels. And users can still telnet in. Does /etc/securetty need to be edited?

I am training my users to ssh on the linux system.

Thanks.

7 replies

by whw

After modifing the runlevels have you rebooted?
Changes to the runlevels won't take affect until the runlevel is changed. The easiest way to do this would be to reboot.

Try
shutdown -r now

and see if telnet is still active after reboot

by whw

I agree with TG2, IF all you had done was modify xinetd, simply restarting the dameon would be sufficent. But, when you said you MODIFIED RUNLEVELS, I tend to like to reboot so that I know everything starts correctly.
Alternatively, if reboot isundesireable,you could (assuming your in runlevel 5)
telinit 3
telinit 5
and that would also restart your runlevels.

by tg2

shame on the previous respondant.. you shouldn't need to reboot the whole machine for ONE service. Daemon's would be in the PS listing, and since its an XINETD provided service, you...

only need to restart XINETD to have changes take effect!

/etc/init.d/xinetd restart

Under most normal circumstances, XINETD will restart without dropping you, leaving your socket open, its that smart.

Also, you can further attempt to restrict access by building an /etc/hosts.deny file and in it put
in.telnetd : all

** in the hosts.deny file, listings like the one above will DENY ALL ip addresses to the service "in.telnetd"

in some cases you can also list it in the /etc/hosts.allow file like this

in.telnetd : all : DENY

wording, syntax, etc. are important and which file you use. hosts.deny has precident over hosts.allow.

if you open TWO ssh sessions, in one, su to root, and then TAIL your log file. In the other window, issue the /etc/init.d/xinetd restart command.

if there is a syntax error, you will see it show up in your messages file (that you have tail'd in your other connection.

tail -f /var/log/messages

(must be root to view messages file if your system is standardly secured, and yes, you could just tail -100 to see the last one hundred lines, but if you follow the tail of the file, you can see your changes as they are made)

by guilbaultf

Hum!!! I have 2 linux RH7.1. One inside the firewall the other one outside. Telnet is disabled on both. I cannot telnet to the system inside the firewall but I can telnet to the outside one.!!
On both systems I do not have any /etc/hosts.deny or /etc/hosts.allow. I have rpm xinetd-2.3.9-0.71 on the outside box and rpm xinetd-2.3.7-4.7x on the inside box. Is the newer version of xinetd bugged!

by tg2

answer to comment.. no. not bugged like that..

open two connections to the one that's still allowing telnet.. in one.. tail /follow your log file, in the other session restart xinetd again.. see what it says its doing.

and runlevel changes don't effect incoming telnet unless you kill xinetd (make that ... unless you unlink/delete link for xinetd in those runlevels that is), but most people don't as its oh so useful ;)

there has to be a reason telnet would still be responding. ie. keywords not the same, two copies of the file.. etc..

tail -f /var/log/messages

and you will see the messages created by Xinet and you should see it disable all then enable the few.

-T

by zeus_ru

Take a look at /etc/inetd.conf and comment telnet if there is.
Maybe you had installed a soft that support the old style inet daemon and look mat the file /etc/inetd.conf for services

This discussion is closed to new replies.