Linux permission denied after chmod a = rwx

So, I have a little problem with Linux, geez, which will teach me how to spend so many years on Windows. Anyway, I made a small java application, a beautifully wrapped Java Wrapper script, but when I ran this script:

sh ./wrapper.sh console 

I immediately get permission. The permission denial message is:

 eval: 1: /home/user1/MyApp/bin/wrapper: Permission denied 

My small wrapper.sh file is located in the MyApp / bin folder. The MyApp / bin / wrapper directory contains 2 files:

  • wrapper-linux-x86-32
  • wrapper-linux-x86-64

As a test, I ran the following chmod command:

 chmod a=rwx MyApp -R 

I checked that everything was rwx, even in subfolders, and tried to run the script again, with the same result ... permission was denied.

Does anyone have an idea of โ€‹โ€‹what I could try to make this baby?

Thank you Lancelot

+6
linux shell permissions wrapper permission-denied
source share
6 answers

I just noticed that the error message refers to the directory name where your file is located:

 eval: 1: /home/user1/MyApp/bin/wrapper: Permission denied 

We know this directory, since you mentioned "MyApp / bin / wrapper directory contains 2 files."

Can you check your script, for example, where do you use the directory name as a command? For example, using the shell (which is the name of the directory) instead of wrapper / wrapper-linux-x86-32 (which will be the name of the file) or similar errors?

Such errors often appear when using spaces in file names and forget to quote the specified file names (perhaps this is not the case here).

Otherwise, could you modify your question to include the contents of the script wrapper that you are calling?

(A new answer, since it is not completely related to the previous idea of โ€‹โ€‹noexec, and that you can stop for reference.)

+8
source share

The file system hosting your script can be mounted using the noexec flag. Check your / etc / fstab entry for this file system, and if there is noexec try to delete it, remount this file system through mount /path/to/mountpoint -o remount

Second, check the output of the mount command for noexec instances instead of / etc / fstab (the file system could be mounted dynamically).

+5
source share

you may also need to execute script execution in your wrapper

chmod + x wrapper.sh

EDIT: I just noticed that your wrapper.sh file is in the MyApp / EDIT folder

also if you make sure that you have

 #!/bin/sh 

at the top of your .sh file, you can execute it as follows:

.wrapper.sh

0
source share

First try opening it in a text editor to make sure you have read access. If yes, then

 chmod +x wrapper.sh 

And make sure you have #!/bin/sh at the beginning of the script

0
source share

You can try to execute a file that was there in another user's home directory, you can give permission to the user "user"

chmod -R a + x / home / user1 or chmod -R o + x / home / user1 chmod -R g + x / home / user1

0
source share

Although my problem was a little different, this question appeared in my search several times, looking for a similar problem, so I will post my results here.

My problem was that I could not access the repository / folder after the chmod command.

After executing the command:

 sudo chmod -755 storage -R //notice -755 is wrong, it should be 755 

I could no longer access the repository / folder.

I tried ls -l :

storage permissions d ---------

Also after git status :

storage / .gitignore: Permission denied

After executing the right command:

 sudo chmod 755 storage -R // without - 

everything returns to normal.

0
source share

All Articles