telnet如何在linux下安裝使用

來源:互聯網
上載者:User

現在管理linux已經很少人用telnet,基本都用crt、xshell或者putty。因為後續需要講zabbix免用戶端監控只telnet,通過telnet來監控伺服器效能。

yum安裝telnet

yum安裝簡單快速
yum install telnet-server

配置telnet

telnet是放在xinetd裡,將disable改為yes,如下:
# vim /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet sessions; it uses \
#       unencrypted username/password pairs for authentication.
service telnet
{
        flags           = REUSE
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/sbin/in.telnetd
        log_on_failure  += USERID
        disable         = no # 從yes改為no
}

如果需要使用root使用telnet登入,加上pts/0、pts1這樣的,否則跳過這一步
# cat /etc/securetty  | grep pts
 pts/0
 pts/1
 pts/2
 pts/3

啟動telnet

# service xinetd start
Starting xinetd:                                           [  OK  ]

確認是否啟動

# netstat -lnt | grep :23
tcp        0      0 :::23                       :::*                        LISTEN

 
建立普通使用者

如果已經有使用者了,那麼可以跳過這一步
# useradd ttlsa # 建立使用者
# passwd ttlsa # 修改密碼
Changing password for user ttlsa.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

telnet串連測試

使用root登入
CentOS release 6.5 (Final)
Kernel 3.15.4-x86_64-linode45 on an x86_64
login: root
Password:
Last login: Thu Feb 12 08:37:11 from 58.246.52.46
[root@li220-237 ~]#

普通使用者登入
CentOS release 6.5 (Final)
Kernel 3.15.4-x86_64-linode45 on an x86_64
login: ttlsa
Password:
$ w
 08:41:05 up 199 days, 21:57,  2 users,  load average: 0.00, 0.01, 0.05
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
ttlsa    pts/1    51.241.12.49     08:40    1.00s  0.00s  0.00s w
root     pts/0    51.241.12.49     08:27    1:37   0.01s  0.01s -bash
$

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.