I just switched over from Kubuntu to Feodra KDE Spin. Now, I have an LVM setup where my home partition is on its own volume. I created a user with the same username as the one I had in the last distro. I was dismayed to find out that I couldn't log in. The screen just went blank, then I saw a blinking cursor, and then I was bounced back to the login screen. I tried to login from a tty, which worked, but I got this wonderful message:
-- user: /home/user: change directory failed: Permission denied
Okay. So I logged in as root and tried to chown everything back to user
. Nothin' goin'. I chmoded my /home/user directory. Still nothing. I'm officially at a loss as to what I should try next, and I thought you fine folks might help. Here's some information for you:
id -u user
1000
stat /home/user/
File: '/home/user/'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: fd02h/64770d Inode: 11272193 Links: 22
Access: (0700/drwx------) Uid: ( 1000/user) Gid: ( 1000/user)
Context: system_u:object_r:unlabeled_t:s0
Access: 2017-06-16 19:42:02.224062623 -0400
Modify: 2017-06-16 19:42:00.651082621 -0400
Change: 2017-06-16 19:42:00.651082621 -0400
Birth: -
It all looks good to me, but what do I know? Strangely enough, when I am logged in as user
, I can cd
into that directory with no issues.
Best Answer
Based upon the OP's information (which, btw, was excellent for the question), the SELinux context was incorrect. In the OP's question, the Context showed as:
Context: system_u:object_r:unlabeled_t:s0
However, a home directory should have
user_home_dir_t
.To resolve the situation, running
restorecon -Rv /home
(using /home ensures that home directories for other users are updated; one could fix just the particular users's home dire byrestorecon -Rv /home/user
) will adjust the situation. The result should be similar to:Using the
-R
would also ensure that directories in the/home/user
were properly adjusted. For example the.ssh
directory has a context ofunconfined_u:object_r:ssh_home_t:s0
.