Azure VM 虚拟机获取 root权限,附root SSH访问权开启方法
一、修改root密码
切换用户:
sudo su root
修改 root 密码:
sudo passwd root
[root@CentOS-VM]# passwd root
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
给root开启SSH访问 权限
需修改 sshd_config
,大概46行快捷键 46gg
sudo vim /etc/ssh/sshd_config
#LoginGraceTime 2m
#PermitRootLogin no # 去掉注释改为 yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
重启ssh
服务
sudo systemctl restart sshd