LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-25-2006, 11:25 PM   #1
ErrorBound
Member
 
Registered: Apr 2006
Posts: 280

Rep: Reputation: 31
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.
 
Old 07-25-2006, 11:31 PM   #2
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 1,979

Rep: Reputation: 290Reputation: 290Reputation: 290
What are the /home mounting options in your /etc/fstab file? You didn't specify "noexec" did you?
 
Old 07-25-2006, 11:45 PM   #3
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
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..
 
Old 07-25-2006, 11:52 PM   #4
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 117Reputation: 117
Please post the output of 'mount'.
 
Old 07-26-2006, 12:30 AM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 1,979

Rep: Reputation: 290Reputation: 290Reputation: 290
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!
 
Old 07-26-2006, 12:49 AM   #6
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
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.
 
Old 07-26-2006, 02:36 AM   #7
Valkyrie_of_valhalla
Member
 
Registered: Jan 2006
Location: Romania
Distribution: Suse 12.0, Slackware 12.1, Debian, Ubuntu, Gentoo
Posts: 301

Rep: Reputation: 30
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.
 
Old 07-26-2006, 08:34 AM   #8
ErrorBound
Member
 
Registered: Apr 2006
Posts: 280

Original Poster
Rep: Reputation: 31
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

Thanks for the help,
 
Old 07-26-2006, 09:21 AM   #9
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 117Reputation: 117
No problem. Glad you got it working so easily.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
can't execute c++ binaries, "permission denied"... even though permission is 777 SerfurJ Programming 14 02-20-2009 04:50 AM
permission denied to home directory ekdya Debian 3 11-08-2005 04:24 PM
Problem Cannot execute /bin/bash: Permission denied xeo Linux - Software 2 10-13-2004 10:55 PM
Cannot execute /bin/bash: Permission denied Hegemon Linux - General 4 01-19-2004 04:13 AM
cannot execute /bin/bash: Permission Denied peeples Linux From Scratch 24 10-25-2002 08:07 AM


All times are GMT -5. The time now is 09:00 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration