Debian – Could not chdir to home directory /home/user: Permission denied

debianlinuxpermissions

After getting a new VPS with Debian 9, I created a new user using root.
I created a new username called joe with this command adduser joe. Then, I used usermod -aG sudo joe to grant administrative privileges.
After that, I logged out and used Putty to login as joe. I entered the password for joe. After entering the password, it displayed this message:
Could not chdir to home directory /home/joe: Permission denied
-bash: /home/joe/.bash_profile: Permission denied

I checked the directory of /home/joe by using this command:

sudo ls -al /home/joe
total 20
drw-r--r-- 2 joe  joe  4096 Feb  7 16:32 .
drwxr-xr-x 4 root root 4096 Feb  7 16:32 ..
-rw-r--r-- 1 joe  joe   220 Feb  7 16:32 .bash_logout
-rw-r--r-- 1 joe  joe  3526 Feb  7 16:32 .bashrc
-rw-r--r-- 1 joe  joe   675 Feb  7 16:32 .profile

How can I enter into /home/joe directory after login as joe?

Best Answer

Apparently /home/joe doesn't have execute permission for the user. Execute permission for the directory allows to traverse it.

Try sudo chmod 755 /home/joe and then log in again.

Related Question