如何在centos下開啟telnet服務?
1.查看linux版本資訊:
[loong@localhost ~]$ cat /etc/issue CentOS release 5.8 (Final)Kernel \r on an \m
2. 查看系統是否已安裝telnet-server,linux系統上預設已經安裝telnet -client(或telnet),而telnet-server需要手動安裝。
[loong@localhost ~]$ rpm -qa | grep telnet telnet-0.17-39.el5
3. 安裝telnet-server,若係統已安裝,跳過此步驟。
方法一:下載RPM resource telnet-server
選擇對應版本的telnet-server下載;
安裝: # rpm -i telnet-server-0.17-39.el5.i386.rpm
#看起來還得單獨安裝xinetd.
方法二:(建議使用)
# yum install telnet-server
安裝完成後:
[loong@localhost ~]$ rpm -qa | grep telnet telnet-0.17-39.el5 telnet-server-0.17-39.el5
4. 啟動telnet服務
#方法一:System->Administration->Services 中,
在 On Demand Services
中選取telnet
,
並在Background Services中選取xinetd,並點選上方的Start,即右側顯示:xinetd (pid 15986) is running...
最後Save & Quit.
方法二:編輯/etc/xinetd.d/telnet
, 將其中的 disable = yes
的yes
改為no
.
修改後:
# default: on# description: The telnet server serves telnet sessions; it uses \ # unencrypted username/password pairs for authentication.service telnet
附註:方法二與方法三,需啟動xinetd服務。方法如下:{
disable = no
flags = REUSE
socket_type = stream
= root
server = /usr/sbin/in.telnetd
#
方法三:使用chkconfig指令直接開啟[root@localhost loong]# chkconfig telnet on
[root@localhost loong]# service xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ]或:
[root@localhost loong]# /etc/rc.d/init.d/xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ]5.測試服務
[root@localhost loong]# telnet localhost Trying 127.0.0.1...Connected to localhost.localdomain (127.0.0.1).Escape character is '^]'.CentOS release 5.8 (Final)Kernel 2.6.18-308.1.1.el5 on an i686 login: loong Password: Last login: Tue Apr 24 16:42:06 from 10.108.14.135[loong@localhost ~]$ exitlogout Connection closed by foreign host.[root@localhost loong]#
註:預設情況下,系統只允許普通使用者telnet登錄,不允許root用戶登入。
要想取得root權限,可以使用普通使用者登錄,然後執行su,來取得root權限。
# mv /etc/securetty /etc/securetty.bak (不建議此方法,測試完後再改回去吧!)
或先嘗試使用root用戶登錄,不成功,然後查看系統log:
telnet> o localhost Trying 127.0.0.1...Connected to localhost.localdomain (127.0.0.1).Escape character is '^]'.CentOS release 5.8 (Final)Kernel 2.6.18-308.1.1.el5 on an i686 login: root Password: Login incorrect login: Login incorrect login: Login incorrect login: Connection closed by foreign host.[root@localhost loong]# tail -20 /var/log/secure Apr 24 17:32:58 localhost login: pam_securetty(remote:auth): access denied: tty 'pts/1' is not secure ! Apr 24 17:33:03 localhost login: FAILED LOGIN 1 FROM localhost FOR root, Authentication failure
可以看到 access denied: tty 'pts/1' is not secure ! 所以将‘pts/1’添加到/etc/securetty中,即可实现telnet的root用户登录。至于为什么?暂不清楚。 方法二:修改/etc/pam.d/remote,注释掉:auth required pam_securetty.so 1 #%PAM-1.02 #auth required pam_securetty.so3 auth include system-auth
註:不建議開放telnet的root登錄,容易帶來安全隱憂。
相關參考:
以上是如何在centos下開啟telnet服務的詳細內容。更多資訊請關注PHP中文網其他相關文章!

CentOS的替代方案包括AlmaLinux、RockyLinux和OracleLinux。 1.AlmaLinux提供RHEL兼容性和社區驅動開發。 2.RockyLinux強調企業級支持和長期維護。 3.OracleLinux提供Oracle特有的優化和支持。這些替代方案都具備與CentOS相似的穩定性和兼容性,適合不同需求的用戶。

CentOS因其穩定性和長生命週期而適合企業和服務器環境。 1.CentOS提供長達10年的支持,適用於需要穩定運行的場景。 2.Ubuntu適合需要快速更新和用戶友好的環境。 3.Debian適用於需要純淨和自由軟件的開發者。 4.Fedora適合喜歡嘗試最新技術的用戶。

CentOS的替代方案包括AlmaLinux、RockyLinux和OracleLinux。 1.AlmaLinux和RockyLinux通過1:1重建RHEL,提供高穩定性和兼容性,適合企業環境。 2.OracleLinux通過UEK提供高性能,適合熟悉Oracle技術棧的用戶。 3.選擇時需考慮穩定性、社區支持和軟件包管理。

CentOS替代方案包括RockyLinux、AlmaLinux和OracleLinux。 1.RockyLinux和AlmaLinux提供與RHEL兼容的穩定發行版,適合需要長期支持的用戶。 2.CentOSStream適合關注新功能和開發週期的用戶。 3.OracleLinux適用於需要企業級支持的用戶。

CentOS需要替代品是因為CentOSStream不再提供長期支持。替代選項包括:1.RockyLinux,提供10年生命週期支持,適合需要穩定性的用戶。 2.AlmaLinux,同樣提供10年支持,有強大社區支持。 3.OracleLinux,提供與RHEL兼容的版本,生命週期管理靈活。

CentOS的終結對用戶產生了重大影響,用戶可選擇RHEL、AlmaLinux、Debian或Ubuntu作為替代方案。 1.遷移成本高,需時間和金錢。 2.社區分裂影響開源項目。 3.RHEL提供商業支持,但成本高。 4.AlmaLinux與CentOS相似,遷移成本低。 5.Debian和Ubuntu需更多時間適應。

CentOS適合作為企業級服務器操作系統,因為它穩定、安全且免費。 1)它基於RHEL,提供與RHEL高度的兼容性。 2)使用yum進行包管理,確保軟件安裝和更新簡便。 3)社區定期發布安全補丁,支持週期長達10年。

CentOS停止維護的原因是RedHat的戰略轉變,用戶應對策略包括:1.遷移到其他發行版,如UbuntuServer、Debian或RockyLinux;2.繼續使用CentOS7至2024年6月;3.轉向CentOSStream;4.自建解決方案,如基於RHEL的定制發行版或使用容器技術。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

MinGW - Minimalist GNU for Windows
這個專案正在遷移到osdn.net/projects/mingw的過程中,你可以繼續在那裡關注我們。 MinGW:GNU編譯器集合(GCC)的本機Windows移植版本,可自由分發的導入函式庫和用於建置本機Windows應用程式的頭檔;包括對MSVC執行時間的擴展,以支援C99功能。 MinGW的所有軟體都可以在64位元Windows平台上運作。

SAP NetWeaver Server Adapter for Eclipse
將Eclipse與SAP NetWeaver應用伺服器整合。

SublimeText3漢化版
中文版,非常好用

記事本++7.3.1
好用且免費的程式碼編輯器

Dreamweaver Mac版
視覺化網頁開發工具