有些VPS商家不會提供默認root賬戶和密碼,有些命令只能通過 sudo su 來提權,可通過以下方法設置root賬戶登錄。 (Some VPS providers do not provide a default root account and password. Some commands can only be executed with elevated privileges using sudo
su
. You can set up a root account login using the following method:)
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config
然後重置密碼(Then set our password for root)
passwd root
重啓ssh服務(Restart sshd service)
sudo service sshd restart