![新的 CentOS 安装登录失败](https://linux22.com/image/73112/%E6%96%B0%E7%9A%84%20CentOS%20%E5%AE%89%E8%A3%85%E7%99%BB%E5%BD%95%E5%A4%B1%E8%B4%A5.png)
我刚刚在新磁盘上安装完 CentOS。我以一种稍微非常规的方式做到了这一点 - 通过yum
在 Debian 中运行完整安装chroot
。所以我在获取 grub 和正确信息时遇到了一些问题fstab
。但现在我觉得我被封锁了。
cat /etc/redhat-release
CentOS Linux 版本 7.1.1503(核心)
系统启动(启动时屏幕上显示所有绿色“确定”),但我无法登录tty
- 当我输入用户名和密码时,屏幕会刷新并显示用户名提示。我可以通过 a 登录这两个帐户chroot
,所以这不是问题。
这是(我认为)相关的部分/var/log/messages
:
Sep 16 01:45:01 localhost systemd: Starting Multi-User System.
Sep 16 01:45:01 localhost systemd: Reached target Multi-User System.
Sep 16 01:45:01 localhost systemd: Starting Graphical Interface.
Sep 16 01:45:01 localhost systemd: Reached target Graphical Interface.
Sep 16 01:45:01 localhost systemd: Starting Update UTMP about System Runlevel Changes...
Sep 16 01:45:01 localhost systemd: Starting Stop Read-Ahead Data Collection 10s After Completed Startup.
Sep 16 01:45:01 localhost systemd: Started Stop Read-Ahead Data Collection 10s After Completed Startup.
Sep 16 01:45:01 localhost systemd: Started Update UTMP about System Runlevel Changes.
Sep 16 01:45:01 localhost systemd: Startup finished in 829ms (kernel) + 4.879s (initrd) + 23.991s (userspace) = 29.700s.
Sep 16 01:45:01 localhost NetworkManager[713]: <info> startup complete
Sep 16 01:45:02 localhost systemd: SELinux policy denies access.
Sep 16 01:45:02 localhost systemd-logind: Failed to start unit user-42.slice: Access denied
Sep 16 01:45:02 localhost systemd-logind: Failed to start user slice: Access denied
Sep 16 01:45:02 localhost systemd-logind: Assertion 's->user->slice' failed at src/login/logind-session.c:515, function session_start_scope(). Aborting.
Sep 16 01:45:02 localhost abrt-hook-ccpp: Saved core dump of pid 609 (/usr/lib/systemd/systemd-logind) to /var/spool/abrt/ccpp-2015-09-16-01:45:02-609 (614400 bytes)
核心转储中的内容backtrace
与CentOS 错误:8905
接下来我将添加SELinux=0
到 grub 启动脚本,但我不想永久这样做。编辑:我通过添加selinux=1 enforcing=0
到我的 grub 引导参数来修复它,然后编辑/etc/sysconfig/selinux
并将状态更改为SELINUX=permissive
我可以登录并且现在一切正常,但是如果我将 SElinux 设置回强制执行,我根本无法登录。仍在寻找答案...
答案1
我遇到了同样的问题。也是非常规的安装,我选择了 extlinux 而不是 grub。我尝试以 root 身份和普通用户身份登录,但都不起作用。
cat /etc/redhat-release
CentOS Linux 版本 7.1.1503(核心)
我通过完整的 SELinux 重新标记解决了这个问题。
# inside the chroot from Debian
touch /.autorelabel
看CentOS SELinux更多细节。