ubuntu 12.04安裝telnet和ssh服務 .

ubuntu安裝telnet服務

1. sudo apt-get install xinetd telnetd

sudo vi /etc/inetd.conf並加入以下一行,假如沒有發現這個文件,自己新建立一個也是可以的哦,剛開始我也不知道,自己試了之後才知道的。


telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd


3. sudo vi /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. 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
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

網絡上也有人說到了root登錄,我覺得倒是沒什麼必要咯,如果您真心想用root,那麼請看看這篇文章吧

http://blog.163.com/chinaqilu@126/blog/static/16562592820107154530753/

我也是按照這個來弄的

 

 

ubuntu ssh服務的安裝

 

Ubuntu 下安裝 OpenSSH Server 是無比輕鬆的一件事情,需要的命令只有一條:
  sudo apt-get install openssh-server

然後確認sshserver是否啓動了:(或用“netstat -tlp”命令)

  ps -e | grep ssh

如果只有ssh-agent那ssh-server還沒有啓動,需要/etc/init.d/ssh start,如果看到sshd那說明ssh-server已經啓動了。

 

ssh-server配置文件位於/ etc/ssh/sshd_config,在這裏可以定義SSH的服務端口,默認端口是22,你可以自己定義成其他端口號,如222。然後重啓SSH服務:

  sudo /etc/init.d/ssh resart

事實上如果沒什麼特別需求,到這裏 OpenSSH Server 就算安裝好了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章