跳至主要内容

设置或更改 EC2 Linux root密码

为根用户添加临时密码的方法如下:
1.    使用 SSH 连接到运行 Linux 的 EC2 实例
2.    运行以下命令来获取根用户许可:
$ sudo su
3.    运行以下命令为根用户创建密码:
# passwd root 
4.    看到提示后,输入您的临时根密码,然后再次输入以确认。
注意:您必须以根用户的身份运行此命令。
完成任务后,运行以下命令删除根密码:
# passwd –d root

评论

此博客中的热门博文

ubuntu 添加root登录

Login to your server as root. As the root user, edit the sshd_config file found in  /etc/ssh/sshd_config : vim /etc/ssh/sshd_config ( For details on working with Vim check out our article here !) Add the following line to the file, you can add it anywhere but it’s good practice to find the block about authentication and add it there. PermitRootLogin yes Save and exit the file. Restart the SSH server: systemctl restart sshd or service sshd restart