讓root可以Telnet

來源:互聯網
上載者:User

   Linux出於安全考慮,預設下,是不允許使用root使用進行Telnet.通常我們是使用普通帳戶進行登入,需要
許可權的時候再用su - 切換到root.下面通常修改/etc/securetty達到效果。以下僅供測試。
試一下使用root telnet登入
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Kernel 2.6.18-164.el5 on an i686
login: root
Password:
Login incorrect
不允許登入
修改/etc/securetty 在裡面加入 pts/0
pts/0        #在檔案前面加的
console
vc/1
vc/2
再試測試
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Kernel 2.6.18-164.el5 on an i686
login: root
Password:
Last login: Wed Dec  8 21:23:35 on tty1
Our server will be maintained at today
[root@lyy ~]#
使用root登入成功!
關於/etc/securetty
該檔案可控制根使用者登入的裝置,該檔案裡記錄的是可以作為根使用者登入的裝置名稱,如tty1、tty2等。使用者是不能從不存在於該檔案裡的裝置
登入狀態根使用者的。這種情況使用者只能以普通使用者登入進來,再用su命令轉為根使用者。/etc/securetty檔案的格式如下:
# /etc/securetty: list of terminals on which root is allowed to login.
# See securetty(5) and login(1).
console
# for people with serial port consoles
ttyS0
# for devfs
tts/0
# Standard consoles
tty1
tty2
tty3
...
如果/etc/securetty是一個空檔案,則根使用者就不能從任務的裝置登入系統。只能以普通使用者登入,再用su命令轉成根使用者。如果/etc/securetty檔案不存在,那麼根使用者可以從任何地方登入。這樣會引發安全問題,所以/etc/securetty檔案在系統中是一定要存在的。

作者“Liyy學習筆記”

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.