一行指令把伺服器端與客戶端一起裝好:
sudo apt-get install openssh-server openssh-client
SSH 服務端的關閉與啟動:

客戶端連線:




1. 安裝 xinetd 與 telnetd:
sudo apt-get install xinetd telnetd
2. 安裝成功後系統會有相應提示。接著編輯 /etc/inetd.conf,加入一行:
telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd
3. 編輯 /etc/xinetd.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
}
includedir /etc/xinetd.d
修改前:

修改後:

4. 編輯 /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
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}

5. 重啟機器,或重啟網路服務:
sudo /etc/init.d/xinetd restart

6. 用 Telnet 客戶端遠端登入即可,注意只能以非 root 帳號存取。
注意事項:安裝時務必把 xinetd 與 telnetd 寫在同一行,不要分開安裝,否則會出現「telnet has no installation candidate」的提示。

補充提醒:Telnet 以明文傳送帳號與密碼,僅適合在封閉的實驗網路中使用;正式環境請一律改用 SSH。