[SOLVED] 'Could not chdir to home directory /home/[user]: Permission denied'

User Name

Remember Me?

Password

Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!

Notices

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

You could try creating a new home directory when logged in as root for the user jon. The following command will modify the user to have the home directory /home/jon_home (it will be created if it doesn't already exist). The -m flag will copy the contents of your existing home into the new directory.

Gah, fixed it by shunting everything to another directory, deleting the user and recreating it and shunting everything back. It's fixed it, but I'd prefer to know why it happened in the first place...thanks anyway everyone for all your help.

This could be selinux related, there is a quick way to check by switching selinux into permissive mode rather than enforcing.

if you edit the file

/etc/sysconfig/selinux

Quote:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0

You should have a similar setup to above. If the SELINUX= entry is set to enforcing then selinux is enabled.
If you change this to SELINUX=permissive save the file and reboot the machine then selinux will change to warning you about policy issues rather than enforcing the security.

Assuming after the reboot you can login without error then you can further diagnose the correct permissions that should be applied on the /home directory.

If you still receive the errors even with selinux in permissive mode then its unlikely to be an selinux issue. You can easily change back to your default setting after performing the test by switching back to enforcing in the same file and again rebooting.

My usual setup is that I have a system partition and a user partition. Every time I upgrade, I just reformat the system partition and install the new system on it. Then I do "groupadd" and "user add" to add myself to the system with the home directory set to my directory in the user partition.

I've been using Fedora and this procedure worked till FC8. The next system reinstall I tried after FC8 was FC11 and that's when I started to see this problem and I went back to FC8.

Last week, my machine died. Luckily, my harddrive was fine and I have another machine that I can use. So, I move my harddrive from the dead machine to the other machine and installed FC13. I see exactly the same problem again! When I logged in, I get the error message and my current working directory is set to / and my login scripts in my user partition are not executed.

Then I started googling this problem and found this thread. I just tried setting SELINUX=permissive and rebooted my machine and, Voila, everything is working! Thanks so much!
--
Bill Cheng

I have also faced the same problem using Fedora 13. I have shared the home directory from an NFS server for all the users in a cluster. Whenever I use SSH to login to a node, it is successful but changing to home directory of the user fails. But when I type cd, it changes to the user's home directory.

I just installed CentOS 6. First time around, I installed the OS on the first drive. Then I added a larger RAID1 partition and copied content of /home into the new RAID1 partition and mounted on /home. Then I got this same problem.