1. 程式人生 > >centOS上安裝Telnet

centOS上安裝Telnet

安裝之前瞭解一下Telnet,在公共網路上用telnet傳輸資料不安全,建議只在本地網路上使用

    Using Telnet in public network(WAN) is very very bad idea. It transmits login data in the clear format. Everything will be sent in plain text.
    If you still need Telnet, It is highly recommended use it in the local area network only.
    Alternatively, you can use SSH. But make sure you’ve disabled root login in SSH.

Telnet是通過TCP/IP協議來連線遠端計算機的,一旦建立連線後,它就變成來虛擬終端,由此實現本地和遠端的通訊。

Telnet is a network protocol which is used to connect to remote computers over TCP/IP network. Once you establish a connection to the remote computer, it becomes a virtual terminal and will allow you to communicate with the remote host from your local system.

In this brief tutorial, let us see how to install Telnet, and how to access remote systems via Telnet.
Installation

Open your terminal and type the following command to install telnet:

1,在伺服器上安裝telnet使用:


yum install telnet telnet-server -y

2,編輯telnet的配置檔案

centOS7可以略過這步,本機為centOS6.7

Be mindful that you don’t have do this step in CentOS 7

edit the telnet configuration file /etc/xinetd.d/telnet;


vi /etc/xinetd.d/telnet

把disable設定為no

Set disable = no:

如下

# 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
}

3,Save and quit the file. .

4,重啟telnet服務

Now restart the telnet service using the following command:


On CentOS 6.x systems:

service xinetd start

5,在啟動伺服器時,自動啟動telnet服務,可做如下設定

Make this service to start automatically on every reboot:

On CentOS 6:

chkconfig telnet on
chkconfig xinetd on

On CentOS 7:

systemctl start telnet.socket
systemctl enable telnet.socket

6,讓telnet預設埠通過防火牆,centOS6.x上,編輯iptables

To allow the telnet port through firewall, Edit file /etc/sysconfig/iptables on CentOS 6.x systems:


vi /etc/sysconfig/iptables

新增這句

-A INPUT -p tcp -m state --state NEW --dport 23 -j ACCEPT

如下

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 23 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

centOS7,可使用如下命令

On CentOS 7, run the following commands to enable telnet service through firewall.

firewall-cmd --permanent --add-port=23/tcp
firewall-cmd --reload

Save and exit the file.

7,重啟iptables服務

Restart iptables service:


service iptables restart

到這裡,伺服器端telnet就安裝好了

建立測試使用者,使用者名稱 sk, 密碼centos

useradd sk
passwd sk

8,客戶端安裝telnet
安裝 telnet 包:

yum install telnet
在ubnutu上使用如下命令:

sudo apt-get install telnet

9,開啟終端,連線伺服器

Now, open Terminal, and try to access your server(remote host).

telnet 伺服器ip

telnet 192.168.1.150

10,輸入在伺服器上設定的使用者名稱密碼

Enter username and password which we have created in the server:

Sample output:

Trying 192.168.1.150...
Connected to 192.168.1.150.
Escape character is '^]'.
Kernel 3.10.0-123.13.2.el7.x86_64 on an x86_64
server1 login: sk
Password:
[[email protected] ~]$

11,ok. That’s it.

Cheers!

原文地址

http://www.unixmen.com/installing-telnet-centosrhelscientific-linux-6-7/

相關推薦

centOS安裝Telnet

安裝之前瞭解一下Telnet,在公共網路上用telnet傳輸資料不安全,建議只在本地網路上使用     Using Telnet in public network(WAN) is very very bad idea. It transmits login data in

centos安裝 Python3x

python centoscentos上安裝 Python3.xx下載源碼包wget wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.gz 2. 安裝依賴yum install -y openssl-devel bzip2-deve

centos 安裝nodejs v8.0.0

成功 entos local code http logs 目錄 鏈接 ech 新建目錄www 下載nodejs wget https://npm.taobao.org/mirrors/node/v8.0.0/node-v8.0.0-linux-x64.tar.xz 解

CentOS安裝owncloud企業私有雲過程

comm ret es2017 height 域名 協作 pub pyc src ## ownclud是什麽? ## >ownCloud 是一個開源免費專業的私有雲存儲項目,它能幫你快速在個人電腦或服務器上架設一套專屬的私有雲文件同步網盤,可以像 Dropbox 那

centos安裝mysql/mariadb安裝gogs

tar.gz 創建 .tar.gz mysql- gogs star 查詢 root賬戶 fas 最小安裝: 1. 選擇English 2. DATE & TIME 修改好本地時間 SOFTWARE SELECTION默認的Minimal Insta

【ASP.NET Core快速入門】(四)在CentOS安裝.NET Core運行時、部署到CentOS

ati libunwind serve code api cal 之前 prompt conn 下載.NET Core SDK 下載地址:https://www.microsoft.com/net/download/windows 第一步:Add the dotne

centos安裝zookeeper

onf entos zkserver roo img 技術分享 root用戶 art 回車 下載zookeeper壓縮包 我使用的是Secure CRT連接工具 首先在centos終端上查看IP地址 使用命令: ifconfig 打開SecureCRT工具,輸入

CentOS安裝Hadoop集群(一)-- Centos系統配置

修改 AD vi命令 分享圖片 命令 wall eth0 host log 在CentOS上安裝Hadoop集群(一) 1、 Centos的系統配置 1.1打開終端方式: 方式1:在桌面單擊右鍵,>>Open in terminal 方式2:Appl

CentOS安裝Redmine-3.4項目管理軟件

redmine1.說明redmine和ruby以及rails的版本號關系如下: Redmine版本 支持Ruby版本 使用Rails版本 4.0 (即將到來的) ruby 2.2,2.3,2.4 R

Centos安裝Apache+Mysql+PHP+WordPress搭建博客

下載 .org 一行 reat 接下來 博客 搭建 admin his 1.安裝Apache 輸入這一行安裝Apache sudo yum install httpd 然後啟動 sudo service httpd start 如果想檢驗是否安裝成功,就在瀏覽器中輸入你服務

Centos 安裝 node.js

path node.js entos 移動 文件 class 測試 AR local 請自行切換 root 用戶進行操作 1. 下載 node.js 的二進制包 https://nodejs.org/en/download/ http://mirrors.ustc.edu.

centos安裝matlab

pan mkdir style one oop 下一步 tlab -s crack #001-下載matlab_R2015b和破解文件(四個)到百度雲盤上下載7.6g#002-上傳matlab大文件先安裝vm tools,然後直接復制到虛擬機桌面#003-掛載matlab鏡

什麽是EPEL 及 Centos安裝EPEL(轉)

pyc TP repos -- i386 性能 centos6 pycurl 問題 什麽是EPEL 及 Centos上安裝EPEL 轉自:http://www.unxmail.com/read.php?67RHEL以及他的衍生發行版如CentOS、Scientific Li

Centos安裝配置MySQL

之前曾在伺服器上安裝配置過MariaDB,畢竟MySQL作為Oracle的產品隨時存在閉源的風險,Red Hat Enterprise Linux / CentOS 7.0從支援MySQL切換到MariaDB作為預設資料庫管理系統。其中MariaDB的預設配置檔案位置在 /etc/my.

在雲伺服器(CentOS)安裝Node

今天手抖,買了臺雲伺服器,本人對伺服器啥的基本不懂,linux命令基本靠度娘,所以連裝個node環境都歷經坎坷,搞了一下午終於搞好了,記錄一下: 第一步:當然是先登入伺服器了,開啟命令列視窗,輸入: ssh [email protected]你的雲伺服器公網IP 回車,輸密碼(你輸密

解決在CentOS安裝mysql出現/lib/ld-linux.so.2: bad ELF interpreter問題和缺少共享庫libstdc++.so.6

方法一: 1.出現 /lib/ld-linux.so.2: bad ELF interpreter問題: 原因:64位linux系統上安裝了32位的軟體會出現這種問題 解決方法:yum install glibc.i686 2.然後重灌

centos安裝theano和Lasagne

1.安裝theano所需的包 sudo yum install python-devel python-nose python-setuptools gcc gcc-gfortran gcc-c++ blas-devel lapack-devel atlas-devel 2.一定要在步驟1完成的基礎上再執

CentOS安裝Python3的方法

我用的環境是centos6.5 1.安裝依賴包 yum -y groupinstall "Development tool

CentOS安裝PostgreSQL9.4.5

1.從http://www.postgresql.org/ftp/source/下載postgreSQL原始碼包,並解壓縮: 2. 編譯安裝: 3.建立使用者,建立目錄,並授權 4.初始化資料庫 5.啟動並檢視程序

Centos安裝Python3

1、檢視Python版本 [[email protected] ~]# python -V #注意,是大寫的V Python 2.7.5 2、安裝Python可能需要依賴的庫 yum install openssl-devel bzip2-devel expat-dev