URL: https://www.opennet.me/cgi-bin/openforum/vsluhboard.cgi
Форум: vsluhforumID1
Нить номер: 20674
[ Назад ]

Исходное сообщение
"Как отключить Telnet во фрее ???"

Отправлено Dusty , 13-Сен-02 10:28 
Как закрыть 23 порт ??? после установки FreeBSD
она его автоматически ставит.

Содержание

Сообщения в этом обсуждении
"RE: Как отключить Telnet во фрее ???"
Отправлено peresvet , 13-Сен-02 10:34 
/etc/inetd.conf ?
/usr/local/etc/rc.d ?

"RE: Как отключить Telnet во фрее ???"
Отправлено lavr , 13-Сен-02 14:53 
>Как закрыть 23 порт ??? после установки FreeBSD
>она его автоматически ставит.

by default telnet закоментарен в /etc/inetd.conf:

less /usr/src/etc/inetd.conf:
# $FreeBSD: src/etc/inetd.conf,v 1.44.2.8 2002/02/20 11:34:46 maxim Exp $
#
# Internet server configuration database
#
# Define *both* IPv4 and IPv6 entries for dual-stack support.
# To disable a service, comment it out by prefixing the line with '#'.
# To enable a service, remove the '#' at the beginning of the line.
#
#ftp    stream  tcp     nowait  root    /usr/libexec/ftpd       ftpd -l
#ftp    stream  tcp6    nowait  root    /usr/libexec/ftpd       ftpd -l
#telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd
#telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd
#shell  stream  tcp     nowait  root    /usr/libexec/rshd       rshd
#shell  stream  tcp6    nowait  root    /usr/libexec/rshd       rshd
#login  stream  tcp     nowait  root    /usr/libexec/rlogind    rlogind
#login  stream  tcp6    nowait  root    /usr/libexec/rlogind    rlogind
#finger stream  tcp     nowait/3/10 nobody /usr/libexec/fingerd fingerd -s
#finger stream  tcp6    nowait/3/10 nobody /usr/libexec/fingerd fingerd -s
#exec   stream  tcp     nowait  root    /usr/libexec/rexecd     rexecd
#uucpd  stream  tcp     nowait  root    /usr/libexec/uucpd      uucpd
#nntp   stream  tcp     nowait  usenet  /usr/libexec/nntpd      nntpd
...
...

если же строка:
grep telnet /etc/inetd.conf
telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd
telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd

заменить на
#telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd
#telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd

после чего выполнить команду, например:

kill -1 `ps -o pid,command -U root | grep inetd | awk '{print $1}'`
или
kill -1 `cat /var/run/inetd.pid`

ну и затем проверить:

telnet localhost
или
telnet hostname

Если же хочется запретить использование самой команды telnet на этом хосте

chmod 550 /usr/bin/telnet