日历

二月
28293031123
45678910
11121314151617
18192021222324
252627282912

分类

shell 基础

can't disable telnet please help~~

奔斗 posted @ 2014年2月09日 01:14 in linux , 937 阅读

参考资料

1.install and enalbe telent

2.enable ssh&telnet

3.diable telent


ubuntu系统在默认情况下是没有启动telent服务的,需要自行配置

1.安装启动基础服务

sudo apt-get install xinetd

2.配置基础文件,在/etc/xinet.conf加入如下几行

# Simple configuration file for xinetd

#

# Some defaults, and include /etc/xinetd.d/

defaults

{

# Please note that you need a log_type line to be able to use log_on_success

# and log_on_failure. The default is the following :

# log_type = SYSLOG daemon info

instances = 60

log_type = SYSLOG authpriv

log_on_success = HOST PID

log_on_failure = HOST

cps = 25 30

}

3.安装telent客户端

sudo apt-get install telnet

4.配置telent文件,nano /etc/xinetd.d/telnet,在此目录下没有telent文件的自己touch

# default: on
# description: The telnet server serves telnet sessions; it uses
# unencrypted username/password pairs for authentication.
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}

更高安全要求配置

only_from = 192.168.120.0/24 #Only users in 192.168.120.0 can access to

only_from = .bob.com #allow access from bob.com

no_access = 192.168.120.{101,105} #not allow access from the two IP.

access_times = 8:00-9:00 20:00-21:00 #allow access in the two times

5.重启xinet服务

sudo /etc/init.d/xinetd restart

6.关闭telent服务,网上的教程是这样做的,但是我却不成功,求搭救~~

把/etc/xinetd.d/telnet 文件的 disable=no 改为yes

重启xinetd服务 sudo /etc/init.d/xinetd restart

> ps:重启xinetd服务 service xinetd restart 也可以,不过我的ubuntu不知道为什么,用tab能调出xinetd但是执行命令却是

stop: Unknown job: xinetd

start: Unknown job: xinetd

>ps 网上的重启xinetd服务是 sudo /etc/rc.d/init.d/xinetd restart 但是我/etc下没有rc.d 不过有rc0~6.d,不知道这个有没有关系呢

 

 


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter