SELinux导致登录不进Linux系统的问题与解决
2008-06-04 14:42
585 查看
SELinux导致登录不进Linux系统的问题与解决
冷胜魁(Seaquester)
lengshengkui@gmail.com
2008-6-4
最近在做Linux USB启动盘时遇到一个问题:用U盘启动,输入用户名和密码之后,屏幕快速的闪过一段提示,然后重新出现login>提示符,始终登录不进去。让我郁闷了好久,在网上搜索了好久,也没有找到答案。
后来我怀疑到SELinux(我的USB启动盘是在Fedora Core 6下面做的,FC6里面有SELinux,U盘的Rootfs里面的文件都是从FC6里面copy过来的)。在U盘的 /var/log/messages 里面看到这样的信息:
May 28 20:59:43 localhost kernel: audit(1168261183.296:4): avc: denied { entrypoint } for pid=2118 comm="login" name="bash" dev=sda1 ino=77521 scontext=root:system_r:hotplug_t:s0-s0:c0.c1023 tcontext=root:object_r:file_t:s0 tclass=file
May 28 21:00:00 localhost kernel: audit(1168261200.421:5): avc: denied { entrypoint } for pid=2120 comm="login" name="bash" dev=sda1 ino=77521 scontext=root:system_r:hotplug_t:s0-s0:c0.c1023 tcontext=root:object_r:file_t:s0 tclass=file
所以我尝试着在U盘的系统里面关掉SELinux,就可以登录进去了。
关闭方法:
1) 在grub.conf里面加一个kenrnel的参数(selinux=0):kernel /boot/vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=ROOT_USB selinux=0
2)修改 /etc/selinux/config 文件,将 SELINUX=Enforcing 改为 SELINUX=disabled。
进一步研究了一下 SELinux,发现,原来是因为Copy到U盘上面的文件的security context变化了(用ls -Z就可以看到),应该在copy的时候加上-Z参数,如:
cp -aZ <source> <dest>
冷胜魁(Seaquester)
lengshengkui@gmail.com
2008-6-4
最近在做Linux USB启动盘时遇到一个问题:用U盘启动,输入用户名和密码之后,屏幕快速的闪过一段提示,然后重新出现login>提示符,始终登录不进去。让我郁闷了好久,在网上搜索了好久,也没有找到答案。
后来我怀疑到SELinux(我的USB启动盘是在Fedora Core 6下面做的,FC6里面有SELinux,U盘的Rootfs里面的文件都是从FC6里面copy过来的)。在U盘的 /var/log/messages 里面看到这样的信息:
May 28 20:59:43 localhost kernel: audit(1168261183.296:4): avc: denied { entrypoint } for pid=2118 comm="login" name="bash" dev=sda1 ino=77521 scontext=root:system_r:hotplug_t:s0-s0:c0.c1023 tcontext=root:object_r:file_t:s0 tclass=file
May 28 21:00:00 localhost kernel: audit(1168261200.421:5): avc: denied { entrypoint } for pid=2120 comm="login" name="bash" dev=sda1 ino=77521 scontext=root:system_r:hotplug_t:s0-s0:c0.c1023 tcontext=root:object_r:file_t:s0 tclass=file
所以我尝试着在U盘的系统里面关掉SELinux,就可以登录进去了。
关闭方法:
1) 在grub.conf里面加一个kenrnel的参数(selinux=0):kernel /boot/vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=ROOT_USB selinux=0
2)修改 /etc/selinux/config 文件,将 SELINUX=Enforcing 改为 SELINUX=disabled。
进一步研究了一下 SELinux,发现,原来是因为Copy到U盘上面的文件的security context变化了(用ls -Z就可以看到),应该在copy的时候加上-Z参数,如:
cp -aZ <source> <dest>
相关文章推荐
- 解决Linux修改环境变量后导致登录循环进不去系统的问题
- 如何解决Xmanager不能登录Linux系统问题
- 解决使用securecrt登录linux系统中文乱码问题
- 解决Linux下pcieport 0000:00:1c.5问题导致的系统根目录/磁盘空间不足
- [linux]服务器Cache占用过多内存导致系统内存不足问题的排查解决
- linux系统重装导致免密码key登录失败的解决方法
- mysql连接linux系统提示“登录出现1130 is not allowed to connect to this MySql server”问题的解决方法
- 解决Linux系统下以PL/SQL工具以sysdba登录报ora-01031权限不足问题
- 解决linux系统下因分区目录划分过小,导致tomcat使用系统临时文件夹(/tmp)没有足够空间而报错的问题
- mysql连接linux系统提示“登录出现1130 is not allowed to connect to this MySql server”问题,解决方法
- 解决Linux系统下SSH远程登录很慢的问题
- mysql连接linux系统提示“登录出现1130 is not allowed to connect to this MySql server”问题,解决方法
- mysql连接linux系统提示“登录出现1130 is not allowed to connect to this MySql server”问题,解决方法
- 解决Linux系统安装后,root用户无法登录,提示“无法验证用户”的错误问题
- grub rescue 方法,解决重装windows系统导致的linux无法启动问题
- mysql连接linux系统提示“登录出现1130 is not allowed to connect to this MySql server”问题,解决方法
- 解决Linux系统因TCP端口不足导致mysql数据库无法访问的问题
- 禅道系统迁移到linux平台 用户无法登录问题的解决
- Linux的Profile文件配置错误导致ubuntu的桌面系统登录不了(解决方法)
- 解决Linux系统安装后,root用户无法登录,提示“无法验证用户”的错误问题