Permission rights problem

  • PT
  • Newbie
  • Newbie
  • PT
  • Posts: 9
  • Loc: Delhi , India

Post 3+ Months Ago

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 ".
  • Don2007
  • Web Master
  • Web Master
  • Don2007
  • Posts: 4924
  • Loc: NY

Post 3+ Months Ago

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?
  • AnarchY SI
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2521
  • Loc: /usr/src/MI

Post 3+ Months Ago

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
  • eggi
  • Novice
  • Novice
  • eggi
  • Posts: 30

Post 3+ Months Ago

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
  • Posts: 39

Post 3+ Months Ago

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 35 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
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.