LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Not able to go to other user's home directory (http://www.linuxquestions.org/questions/linux-software-2/not-able-to-go-to-other-users-home-directory-345240/)

biswajit_dey 07-21-2005 12:02 AM

Not able to go to other user's home directory
 
Hi,
I am getting a permission denied message if i try to go to some other usrs home directory

e.g if i give cd ~test to go to test's home directory i get a message like this.

-bash: cd: /home/test: Permission denied


Also, I am not able to copy any files from other user's directory to mine.

e.g if i give cp ~test/temp i get a message like this

cp: cannot stat `/home/test/temp': Permission denied


Can neone help me out.

Bruce Hill 07-21-2005 12:11 AM

I can cd ~username to another user's directory as other than that user,
but I don't see the point, because I cannot execute any commands as
other than that user, unless I'm root. Unless you change perms on the
directory where other users have rights.

Read this thread, especially the part about group.

johnson_steve 07-21-2005 12:30 AM

Um, if you could then people could go around deleteing each others files and copy homework and the like. thats kind of the point of file permisions on a multi-user system so you can't mess around with files that don't belong to your user. if it's your box su to become root then you should have access to everything. If you want you can then change the permisions so your user has access with chmod like this:

chmod 666 file

666 - everyone can read and write

777 - everyone can read write and exicute (or in the case of a directory enter)

Artik 07-21-2005 04:17 AM

Re: Not able to go to other user's home directory
 
Quote:

Originally posted by biswajit_dey
Hi,
I am getting a permission denied message if i try to go to some other usrs home directory

e.g if i give cd ~test to go to test's home directory i get a message like this.

-bash: cd: /home/test: Permission denied


Also, I am not able to copy any files from other user's directory to mine.

e.g if i give cp ~test/temp i get a message like this

cp: cannot stat `/home/test/temp': Permission denied


Can neone help me out.

Two possible resons (that I think on them):
  • User "test" had denied permossions for reading his directory by setting chmod 700 - I also do this for sertain directories to prevent read access of other people ;) - so you should talk to him
  • Default umask is something else then 0022 for this user or in system... Default setting may be different - not allowing other user view and brows directories. Take a look on /etc/profile. (grep umask /etc/profile )

Nathanael 07-21-2005 04:24 AM

unless you get permission by the user who ownes the directory, you should not even try to get into his home dir.

motub 07-21-2005 06:28 AM

It's not like there's anything in there that you should want anyway-- /home/username is mostly full of personal config files by default. If the other user has been "foolishly" saving data there that you have a reasonable need or right to have access to , then the other user should share the folder in which that data is kept via the distribution's file-sharing configuration.

In other words, the user's home directory is private and exclusive to the user-- it's their house, and the door is locked. No one else has the right to just walk in and snuffle around without the owner's express permission (the user unlocks the door and lets you in to use the toilet, and only the toilet, i.e., sharing the "toilet" folder with someone else), with the exception of the police or fire department (root), and even then, only with a good reason (the user is broke and root needs to fix it). Otherwise, "there's nothing to see here in another user's /home folder, move along".

Nathanael 07-21-2005 08:14 AM

nice one motub :-)


All times are GMT -5. The time now is 02:13 PM.