LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Permission denied to execute anything under /home (https://www.linuxquestions.org/questions/linux-software-2/permission-denied-to-execute-anything-under-home-467687/)

ErrorBound 07-25-2006 11:25 PM

Permission denied to execute anything under /home
 
As the title says. Recently I moved /home over to it's own partition so I had to change the owners back, but the permissions seem right. It definetely worked before but I think this is the first time I have tried since I switched it over.

I tried making a simple C++ 'hello world' to figure this out. In my home directory, the binary helloworld has permissions -rwxr-xr-x. However trying to execute this (./helloworld) gives me "bash: ./helloworld: Permission denied". I can chmod 777 and chmod +x all I like, but nothing changes. Also, root gets the same error trying to execute this anywhere under /home. However root can execute it when it is located under /root.

I really don't understand.

haertig 07-25-2006 11:31 PM

What are the /home mounting options in your /etc/fstab file? You didn't specify "noexec" did you?

b0uncer 07-25-2006 11:45 PM

Hmm..also make sure the directory /home/$USER has execute permissions set too. Actually this is the first time I've thought of this, but if you happened to remove execute permissions from a directory, would it prevent you from executing files from inside the directory as well (why else would you be able to set directory's execute permissions?)

Just in case, try
Code:

chmod a+x /home/$USER
And see if it did the trick. I have no clue if it should work, so don't get too enthusiastic..

Matir 07-25-2006 11:52 PM

Please post the output of 'mount'.

haertig 07-26-2006 12:30 AM

Quote:

Originally Posted by b0uncer
...(why else would you be able to set directory's execute permissions?)

Execute permission on a directory allows you to "cd" to it. If you can't cd to it, you can't execute anything there either. Generally when you want to keep people out of a directory you remove all permissions. It is possible to create a directory with read permissions but not execute permissions, but you get some pretty funkly looking ls -l output!

spooon 07-26-2006 12:49 AM

Quote:

Originally Posted by b0uncer
(why else would you be able to set directory's execute permissions?)

Very commonly, you want to allow a directory execute permission but deny read permission; that way, things that know the proper filenames will still have as much access to them as before, but won't be able to list the directory.

Valkyrie_of_valhalla 07-26-2006 02:36 AM

I can't give you a direct answer to this, but I can explain a similar problem. I use the Pascal programing language, and use fpc to compile it. Sometimes, when I try to execute it, it gives me the permission denied error, especially if I make a program that reads/writes from other files. And this happens even if I am logged in as root.
My only advice is to experiment with chmod on all the files the program should access, including maybe the compiler's ones...
And another small detail... Are you sure you have all permissions in that directory? On some linux versions, you have a /home/username folder to which you have access, but don't have in /home .
Also check the mount parameters, that fixed another permissions problem of mine, although I can't help you much here.

ErrorBound 07-26-2006 08:34 AM

Quote:

Originally Posted by haertig
What are the /home mounting options in your /etc/fstab file? You didn't specify "noexec" did you?

That was it. I changed it to "exec" and it's back to working again. I probably should have paid attention when I was editing fstab instead of just copying over one of the other entries :rolleyes:

Thanks for the help,

Matir 07-26-2006 09:21 AM

No problem. Glad you got it working so easily. :)


All times are GMT -5. The time now is 10:37 PM.