n/chit-chatu/Anonymous6 · 2024-11-19
注册 登录
n/chit-chat · 2024-11-19 · 388 次浏览
u/Anonymous6白银

谷歌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
登录后参与讨论。

2 条回复

排序
  1. lusky 荣誉会员 铂金 圣贤 2024-11-19

    [[13],[1]]

    0
  2. lusky 荣誉会员 铂金 圣贤 2024-11-19

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

    0