啟用或停用遠端 root 登入

必要時,可以視需要啟用或停用 root 帳戶的遠端登入。

關於這項作業

在安裝、升級或主機維護作業之後,可以停用 root 帳戶的遠端登入。

程序

若要啟用遠端 root 登入,請輸入下列指令:

#vim  /etc/ssh/sshd_config

                                PermitRootLogin yes #enabled

若要停用遠端 root 登入,請輸入下列指令:

#vim  /etc/ssh/sshd_config

                               PermitRootLogin no #disabled

結果

若要讓變更生效,必須重新啟動 SSH 常駐程式:

# /etc/init.d/sshd restart

Scroll to Top