生活随笔
收集整理的這篇文章主要介紹了
Ubuntu 10.10 下配置Telnet服务器
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
首先說明我的系統環境:
Ubuntu
?10.10 x86 Desktop
在這個系統上默認只安裝了telnet(也就是client)
root@www.linuxidc.com:~#?dpkg?-s?telnet?Package:?telnet?Status:?install?ok?installed?Priority:?standard?Section:?net?Installed-Size:?188?Maintainer:?Ubuntu?Developers?<ubuntu-devel-discuss@lists.ubuntu.com>?Architecture:?i386?Source:?netkit-telnet?Version:?0.17-36build1?Replaces:?netstd?Provides:?telnet-client?
所以只能用telnet命令登錄別人開啟telnet服務的主機,其他人是不能使用telnet登錄本機的。
1,現在要說的就是讓別人能夠使用telnet登錄本機,需要安裝兩個軟件:
root@www.linuxidc.com:~#?apt-get?install?telnetd?root@www.linuxidc.com:~#?apt-get?install?xinetd?
其中telnetd是telnet-server,但它是無法自我啟動的,需要管理daemon的軟件xinetd來接管。
root@www.linuxidc.com:~#?dpkg?-s?telnetd?Package:?telnetd?Status:?install?ok?installed?Priority:?optional?Section:?net?Installed-Size:?152?Maintainer:?Ubuntu?Developers?<ubuntu-devel-discuss@lists.ubuntu.com>?Architecture:?i386?Source:?netkit-telnet?Version:?0.17-36build1?Replaces:?netstd?Provides:?telnet-server?
2,通過xinetd啟動telnetd,方法是新建telnet文件,并輸入如下內容(沒有安全性設置)
root@www.linuxidc.com:~#vi /etc/xinetd.d/telnetservice?telnet?{?????????disable?=?no?????????socket_type?=?stream?????????flags?=?REUSE?????????wait?=?no?????????user?=?root?????????server?=?/usr/sbin/in.telnetd? #特別注意此處,in.telnetd是telnetd安裝產生的文件????????log_on_failure?+=?USERID?}?
如果要修改telnet的默認端口號(23),需要修改/etc/services文件中對應的telnet
3,然后重啟xinetd程序
root@www.linuxidc.com:/etc/xinetd.d#?service?xinetd?restart??*?Stopping?internet?superserver?xinetd??????????????????????????????????[?OK?]???*?Starting?internet?superserver?xinetd??????????????????????????????????[?OK?]?
這時候可以是使用netstat命令查看23端口監聽情況
root@www.linuxidc.com:~#?netstat?-tulnp?|?grep?23?tcp????????0??????0?0.0.0.0:23??????????????0.0.0.0:*???????????????LISTEN??????4176/xinetd??
4,可以確定telnet服務器已經搭建完成,這時只需要換個電腦,然后使用telnet ip即可登錄。默認的設定是root不能通過telnet登錄(telnet在網絡上是明文傳輸,可以被sniffer偵測出密碼),如果安全性有保證,可以通過一下方法允許root登錄:
(1)修改/etc/securetty文件,添加終端
root@www.linuxidc.com:~#?tail?-5?/etc/securetty??pts/0?pts/1?pts/2?pts/3?pts/4?
或者直接將securetty文件改名,即可使用root登錄
(2)修改/etc/pam.d/login文件,將securetty驗證注釋調
12??#?Disallows?root?logins?except?on?tty's?listed?in?/etc/securetty?13??#?(Replaces?the?`CONSOLE'?setting?from?login.defs)?14??#?Note?that?it?is?included?as?a?"required"?module.?root?will?be?15??#?prompted?for?a?password?on?insecure?ttys.?16??#?If?you?change?it?to?a?"requisite"?module,?make?sure?this?does?not?leak?17??#?user?name?information.?18??#auth???????required??pam_securetty.so?
這樣telnet基本上就配置完成了,不過還是建議大家用ssh(但windows系統要用ssh還要附加專門的軟件,真的很艸蛋!
http://www.linuxidc.com/Linux/2011-10/44291.htm
總結
以上是生活随笔為你收集整理的Ubuntu 10.10 下配置Telnet服务器的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。