Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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..
...(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!
(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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.