parallels desktop 安装centos7默认密码和root问题

 

parallels desktop下载的centos7 默认用户名是parallels 密码是需要设置的。软件没有自动设置。密码必须大于8位;

并且无法进行su命令,提示 Authentication failure。

这个问题产生的原因是由于系统默认是没有激活root用户的,需要我们手工进行操作,在命令行界面下,或者在终端中输入如下命令:

sudo passwd root
Password:你当前的密码
Enter new UNIX password:这个是root的密码
Retype new UNIX password:重复root的密码

然后会提示成功的信息。 在说明一点,使用su和sudo是有区别的,使用su切换用户需要输入所切换到的用户的密码,而使用sudo则是当前用户的密码。

ubuntu:

此时重启计算机,使用root登陆图形界面提示"抱歉,认证失败,请重试,无法登陆图形界面。

1设置root用户登陆图形界面。

2运行命令"sudo vi /etc/pam.d/gdm-autologin"。

3.注释行 "auth requied pam_succeed_if.so user != root quiet success"。

4.运行命令"sudo vi /etc/pam.d/gdm-password"。

5.注释行 "auth requied pam_succeed_if.so user != root quiet success"。

6.此时重启计算机,使用root账户登陆,出现错误提示:Error found when loading/root/.profile:mesg: ttyname失败: 对设备不适当的ioctl操作,As a result the session will not be configured correctly.You shoud fix the problem as soon as feasible。

7.运行命令"sudo vi /root/.profile"。

8.在行"mesg n || true"前添加"tty -s && ",变为"tty -s && mesg n || true",此时重启计算机,使用root账户登陆正常。

如果远程root还是登陆不了的话

解决问题

1、确认ssh服务已安装,通过普通用户连接成功;

2、确认ssh配置是否对root进行特殊设置,修改/etc/ssh/sshd_config文件中

      PermitRootLogin without-password将 without-password改为yes;

      为:PermitRootLogin  YES        esc  :wq  推出

3、重启ssh服务/etc/init.d/ssh restart;  成功 !  root  可以远程访问了

你可能感兴趣的:(Linux)