生活随笔
收集整理的這篇文章主要介紹了
Ubuntu 10.10 下配置Telnet服务器
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
首先說(shuō)明我的系統(tǒng)環(huán)境:
Ubuntu
?10.10 x86 Desktop
在這個(gè)系統(tǒng)上默認(rèn)只安裝了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服務(wù)的主機(jī),其他人是不能使用telnet登錄本機(jī)的。
1,現(xiàn)在要說(shuō)的就是讓別人能夠使用telnet登錄本機(jī),需要安裝兩個(gè)軟件:
root@www.linuxidc.com:~#?apt-get?install?telnetd?root@www.linuxidc.com:~#?apt-get?install?xinetd?
其中telnetd是telnet-server,但它是無(wú)法自我啟動(dòng)的,需要管理daemon的軟件xinetd來(lái)接管。
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,通過(guò)xinetd啟動(dòng)telnetd,方法是新建telnet文件,并輸入如下內(nèi)容(沒(méi)有安全性設(shè)置)
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安裝產(chǎn)生的文件????????log_on_failure?+=?USERID?}?
如果要修改telnet的默認(rèn)端口號(hào)(23),需要修改/etc/services文件中對(duì)應(yīng)的telnet
3,然后重啟xinetd程序
root@www.linuxidc.com:/etc/xinetd.d#?service?xinetd?restart??*?Stopping?internet?superserver?xinetd??????????????????????????????????[?OK?]???*?Starting?internet?superserver?xinetd??????????????????????????????????[?OK?]?
這時(shí)候可以是使用netstat命令查看23端口監(jiān)聽情況
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服務(wù)器已經(jīng)搭建完成,這時(shí)只需要換個(gè)電腦,然后使用telnet ip即可登錄。默認(rèn)的設(shè)定是root不能通過(guò)telnet登錄(telnet在網(wǎng)絡(luò)上是明文傳輸,可以被sniffer偵測(cè)出密碼),如果安全性有保證,可以通過(guò)一下方法允許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驗(yàn)證注釋調(diào)
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基本上就配置完成了,不過(guò)還是建議大家用ssh(但windows系統(tǒng)要用ssh還要附加專門的軟件,真的很艸蛋!
http://www.linuxidc.com/Linux/2011-10/44291.htm
總結(jié)
以上是生活随笔為你收集整理的Ubuntu 10.10 下配置Telnet服务器的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。