Sign up Log in
n/chit-chat · 2024-11-19 · 403 views
u/Anonymous6Silver
n/chit-chatu/Anonymous6 · 2024-11-19

谷歌VPS添加root密码全过程

切换root权限
sudo -i

CentOS和Debian利用以下命令开启:
sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config

Ubuntu系统采用以下命令:
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config

设置Root登陆密码
passwd root
重启sshd服务
service sshd restart
利用reboot重启VM实例即可.

0
2
Log into join the discussion.

2 replies

Sort order
  1. lusky Honorary Member Platinum Sage 2024-11-19

    [[13],[1]]

    0
  2. lusky Honorary Member Platinum Sage 2024-11-19

    不是科学发日常,下次注意哦

    0