Why the users can not log into the system ?
Environment
- Red Hat Enterprise Linux 5 ( RHEL5 )
- Selinux
Issue
- System had a power outage and
/varfilesystem needed to be repaired - The system boots correctly but the users can not log into the system
Resolution
- Relabel the filesystems
# touch /.autorelabel
# reboot
- After setting the contexts, all the users can start their session normally
Root Cause
- Running
fsckrepaired the filesystem but did not restore the selinux contexts correctly
Diagnostic Steps
- No messages are recorded in
/var/log/messages -
If booting into runlevel 1, users can log in
-
The following messages appear in
/var/log/audit/audit.log
type=AVC msg=audit(1345452695.644:89): avc: denied { getattr } for pid=6252 comm="bash" path="/home/username/.bash_profile" dev=dm-4 ino=190471 scontext=user_u:system_r:hotplug_t:s0 tcontext=user_ u:object_r:user_home_t:s0 tclass=file
type=AVC msg=audit(1345452697.366:93): avc: denied { write } for pid=6252 comm="bash" name="username" dev=dm-4 ino=190465 scontext=user_u:system_r:hotplug_t:s0 tcontext=user_u:object_r:user_home_d ir_t:s0 tclass=dir
type=AVC msg=audit(1345452697.388:96): avc: denied { getattr } for pid=6252 comm="bash" path="/home/username/.bash_history" dev=dm-4 ino=190473 scontext=user_u:system_r:hotplug_t:s0 tcontext=user_ u:object_r:user_home_dir_t:s0 tclass=file
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
