LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Could not chdir to home directory (https://www.linuxquestions.org/questions/linux-newbie-8/could-not-chdir-to-home-directory-4175465255/)

vignesh_murali2003 06-08-2013 12:56 PM

Could not chdir to home directory
 
Could not chdir to home directory /net/tiger/home/vlad: Permission denied
-bash: /net/tiger/home/vlad/.bash_profile: Permission denied

all the users when I try to ssh have the same problem. But when I login from other system it is working fine. I checked with the permissions it is set correctly.

jdkaye 06-08-2013 01:57 PM

Are you logged in as vlad when you get that error message? Can you post the output of
Code:

ls -l /net/tiger/home/
jdk

vignesh_murali2003 06-08-2013 02:43 PM

ls: cannot open directory /net/tiger/home/: Permission denied

the permissions are 700 but when i set it to 755 it works. But for my company rules it should be 700

jdkaye 06-08-2013 11:58 PM

You didn't answer my question. Who owns the file/directory and who are you logged in as.
Mode 700 allows only the owner of the file/folder to read it. Mode 755 allows anyone to read it. I deduce that you are not logged in as the owner of the file/folder. If you log in as the owner of the file/folder then your command will succeed.
Got it?
jdk

Madhu Desai 06-09-2013 12:22 AM

home directory must always be set to 755(rwxr-xr-x), and within that all individual users directories must be set to 700(rwx------).

Example:
Code:

$ ls -ld /home
drwxr-xr-x. 5 root root 4096 Jun  9 10:40 /home

$ ls -l /home
total 24
drwx------. 52 user1 user1  4096 Jun  9 10:21 user1
drwx------.  4 user2 user2  4096 Jun  9 10:42 user2


jdkaye 06-09-2013 01:46 AM

You must be logged in as user1 to look at the user1 folder or chown to another owner
You must be logged in as user2 to look at the user2 folder or chown to another owner
jdk

chrism01 06-09-2013 09:04 PM

You need to be root to chown files/dirs.


All times are GMT -5. The time now is 03:52 AM.