Ubuntu下安裝建立Telnet伺服器

來源:互聯網
上載者:User

最近利用實驗室裡的一台空閑Ubuntu電腦建立一台telnet伺服器,供實驗室人學習上傳資料用。雖然十分簡單,但還是總結一下,希望對我們初學者有所幫組。

開啟伺服器上的shell視窗,按以下步驟操作:

1.執行命令:sudo apt-get intall xinted telnetd //安裝telnet軟體包,sudo命令需輸入目前使用者密碼

 

2.安裝成功後系統有相應提示。執行命令:sudo vi /etc/inetd.conf //開啟telnet設定檔

註:有的版本vi 命令不能用,可以先安裝:sudo apt-get install vim.即可。或者使用:

sudo gedit /etc/inetd.conf, 也可進入編輯視窗。

3.在編輯視窗裡對照下面的代碼,添加進紅色的部分,然後儲存關閉編輯視窗。

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

includedir /etc/xinetd.d

4. sudo vi /etc/xinetd.d/telnet 進入編輯視窗,添加以下紅色部分。

# default: on
# description: The telnet server serves telnet sessions; it uses
# unencrypted username/password pairs for authentication.
service telnet
{
disable = no

bind =219.228.57.4
only_from=219.228.1.0/24
#上面這兩行說明僅提供內部網段!
Instance =UNLIMITED
Nice =0
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}

5. 重啟:sudo restart

or 重啟網路服務:sudo /etc/init.d/xinetd restart

即可使用非root使用者登入。

當然,telnet是Ubuntu內建的一個簡單的遠程登入工具。但使用起來還不是非常方便。只能做一些簡單的操作命令。使用putty軟體更方便。具體安裝如下:

sudo apt-get install openssh-server
由於預設Ubuntu採用UTF-8的字元集,所以putty需要做一些設定:
點擊左邊的 Windows -> Appearance 設定 Font settings ,點擊 Change... 按鈕選擇為 仿宋體 或者 新宋體。 點擊左邊的 Windows -> Translation 設定 Character set translation 為 UTF-8 。然後,點擊 Open 串連伺服器即可。
 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.