ubuntu 20.04 设置允许root登录
Ubuntu默认不设置 root 帐户和密码。如有需要,可在设置中开启允许 root 用户登录。具体操作步骤如下:
问题描述
Invalid/incorrect password: Warning: Permanently added '192.168.1.156' (ECDSA) to the list of known hosts. Permission denied, please try again.
解决办法:
1、首先使用普通用户登录
2、设置root密码
yang@master:~$ sudo passwd root New password: Retype new password: passwd: password updated successfully
3、编辑配置文件,解除禁用root
sudo vim /etc/ssh/sshd_config 1.#PermitRootLogin prohibit-password 修改为:PermitRootLogin yes 2.PasswordAuthentication yes
4、重启ssh服务
sudo service ssh restart
5、测试连接
root@master:~#