Permission rights problem

  • PT
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Nov 21, 2007
  • Posts: 9
  • Loc: Delhi , India
  • Status: Offline

Post April 2nd, 2008, 11:01 pm

We have two users on a fedora linux machine. A script is owned by one user and another user wants to run it.

As root user, we have changed the permissions of that file by running the command : chmod 777 scriptfilename

The file shows "rwx" permissions for owner, users and others group, but 2nd user is not able to run that script and it says "Permission denied ".
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post April 2nd, 2008, 11:01 pm

  • Don2007
  • Web Master
  • Web Master
  • No Avatar
  • Joined: Nov 21, 2006
  • Posts: 4924
  • Loc: NY
  • Status: Offline

Post April 3rd, 2008, 5:35 am

Where is the script located? Is it in /usr/local/bin or something like that? What directory is the user in when he tries to run the command? Does the user have permission to the parent directory?
How do you know when a politician is lying? His mouth is moving.
  • AnarchY SI
  • Web Master
  • Web Master
  • User avatar
  • Joined: Oct 30, 2004
  • Posts: 2521
  • Loc: /usr/src/MI
  • Status: Offline

Post April 3rd, 2008, 1:01 pm

if the script is in user1's home directory, user2 will not be able to access it because like don was suggesting, user2 doesn't have any permissions to user1's home directory. so make sure that the script exists in a directory that both users have permissions to
Image
"In a world without walls and fences, who needs Windows and Gates?"
  • eggi
  • Novice
  • Novice
  • No Avatar
  • Joined: Oct 13, 2007
  • Posts: 30
  • Status: Offline

Post April 6th, 2008, 7:22 pm

Yes,

You'll have to consider permissions from the file up. So, if the file is /home/dir/file and dir is 700, it won't matter what perms you give to the file.

On another note, if you don't want to give permissions to the world for rwx, you can create a group and add both users to it, or implement whatever your OS's version of facl's is so that the user has extended permission to access the file while the file keeps its regular permissions for security.

, Mike
  • geekdw
  • Beginner
  • Beginner
  • User avatar
  • Joined: Dec 12, 2007
  • Posts: 39
  • Status: Offline

Post April 7th, 2008, 12:00 pm

This helps me out too...I didn't know that. It might have been the reason for whatever problems I might have had in the past. Thanks for the tip anyway :)

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 76 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.