Cannot execute script while its permission is 'x'Firefox script errorInstall linux bash script from windows to a remote linux systemHow to invoke shell script while staying in interactive modehow to grant execute permission without read permission?How do I get a shell script to run at start-up with cron?execute function in different shelllinux why can't i execute a script as rootHow to give script read access to files in a directory on LinuxCannot update Symbol Links - Permission Deniedpython subprocess.run() doesn't wait for sh script completion
Blood-based alcohol for vampires?
Language Selector
Is it possible to spoof an IP address to an exact number?
Are there advantages in writing by hand over typing out a story?
Will greasing clutch parts make it softer
Auto replacement of characters
Where is read command?
Why did my leaking pool light trip the circuit breaker, but not the GFCI?
What caused the flashes in the video footage of Chernobyl?
Why is quantum gravity non-renormalizable?
Does this circuit have marginal voltage level problem?
Should I warn my boss I might take sick leave
How to create a 2D table with varying step?
What is a "tittering order"?
Can you move between the attacks of a Twinned Booming Blade?
Should I cheat if the majority does it?
What do you call the angle of the direction of an airplane?
Phrase origin: "You ain't got to go home but you got to get out of here."
What can a novel do that film and TV cannot?
How come having a Deathly Hallow is not a big deal?
Was Wolfgang Unzicker the last Amateur GM?
What is meaning of 4 letter acronyms in Roman names like Titus Flavius T. f. T. n. Sabinus?
Can I deep fry food in butter instead of vegetable oil?
Should I hide my travel history to the UK when I apply for an Australian visa?
Cannot execute script while its permission is 'x'
Firefox script errorInstall linux bash script from windows to a remote linux systemHow to invoke shell script while staying in interactive modehow to grant execute permission without read permission?How do I get a shell script to run at start-up with cron?execute function in different shelllinux why can't i execute a script as rootHow to give script read access to files in a directory on LinuxCannot update Symbol Links - Permission Deniedpython subprocess.run() doesn't wait for sh script completion
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a script in the current directory, however, given that:
- the permission is
-rwxr-xr-x
- the script has a shebang
#!/bin/bash
at the top of the file - my shell is
/bin/bash
- I can execute it using
bash script.sh
I cannot execute it using ./script.sh
. It gives me:
bash: ./script.sh: Permission denied
Why is this happening and what is the solution?
linux bash shell
add a comment |
I have a script in the current directory, however, given that:
- the permission is
-rwxr-xr-x
- the script has a shebang
#!/bin/bash
at the top of the file - my shell is
/bin/bash
- I can execute it using
bash script.sh
I cannot execute it using ./script.sh
. It gives me:
bash: ./script.sh: Permission denied
Why is this happening and what is the solution?
linux bash shell
add a comment |
I have a script in the current directory, however, given that:
- the permission is
-rwxr-xr-x
- the script has a shebang
#!/bin/bash
at the top of the file - my shell is
/bin/bash
- I can execute it using
bash script.sh
I cannot execute it using ./script.sh
. It gives me:
bash: ./script.sh: Permission denied
Why is this happening and what is the solution?
linux bash shell
I have a script in the current directory, however, given that:
- the permission is
-rwxr-xr-x
- the script has a shebang
#!/bin/bash
at the top of the file - my shell is
/bin/bash
- I can execute it using
bash script.sh
I cannot execute it using ./script.sh
. It gives me:
bash: ./script.sh: Permission denied
Why is this happening and what is the solution?
linux bash shell
linux bash shell
edited Jun 25 at 22:02
Peter Mortensen
8,46616 gold badges61 silver badges85 bronze badges
8,46616 gold badges61 silver badges85 bronze badges
asked Jun 24 at 21:01
HenryHenry
1887 bronze badges
1887 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The execution is not allowed because the file is on a filesystem mounted with the "noexec" option. Use
findmnt -u -T .
to find out if that's the case. If you have root privileges,mount -o remount,exec <dir>
should remove this option.The execution is not allowed by MAC policies (SELinux, SMACK, possibly AppArmor). Check the system logs, starting with
journalctl -n 100
anddmesg
. Bypassing this (if you're the administrator) depends on which MAC system is actually in use.
3
Thank you, in my case it isnoexec
. I got confused, I have this disk mount as/home ext4 auto,exec,rw,async,user 0 2
in/etc/fstab
, why is itnoexec
?
– Henry
Jun 24 at 21:28
6
Because you have theuser
option in there.
– grawity
Jun 25 at 14:15
What is MAC (in this context)? Not MAC address, I presume(?).
– Peter Mortensen
Jun 25 at 22:03
3
Mandatory Access Control
– Dancrumb
Jun 25 at 22:25
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "3"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1452496%2fcannot-execute-script-while-its-permission-is-x%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The execution is not allowed because the file is on a filesystem mounted with the "noexec" option. Use
findmnt -u -T .
to find out if that's the case. If you have root privileges,mount -o remount,exec <dir>
should remove this option.The execution is not allowed by MAC policies (SELinux, SMACK, possibly AppArmor). Check the system logs, starting with
journalctl -n 100
anddmesg
. Bypassing this (if you're the administrator) depends on which MAC system is actually in use.
3
Thank you, in my case it isnoexec
. I got confused, I have this disk mount as/home ext4 auto,exec,rw,async,user 0 2
in/etc/fstab
, why is itnoexec
?
– Henry
Jun 24 at 21:28
6
Because you have theuser
option in there.
– grawity
Jun 25 at 14:15
What is MAC (in this context)? Not MAC address, I presume(?).
– Peter Mortensen
Jun 25 at 22:03
3
Mandatory Access Control
– Dancrumb
Jun 25 at 22:25
add a comment |
The execution is not allowed because the file is on a filesystem mounted with the "noexec" option. Use
findmnt -u -T .
to find out if that's the case. If you have root privileges,mount -o remount,exec <dir>
should remove this option.The execution is not allowed by MAC policies (SELinux, SMACK, possibly AppArmor). Check the system logs, starting with
journalctl -n 100
anddmesg
. Bypassing this (if you're the administrator) depends on which MAC system is actually in use.
3
Thank you, in my case it isnoexec
. I got confused, I have this disk mount as/home ext4 auto,exec,rw,async,user 0 2
in/etc/fstab
, why is itnoexec
?
– Henry
Jun 24 at 21:28
6
Because you have theuser
option in there.
– grawity
Jun 25 at 14:15
What is MAC (in this context)? Not MAC address, I presume(?).
– Peter Mortensen
Jun 25 at 22:03
3
Mandatory Access Control
– Dancrumb
Jun 25 at 22:25
add a comment |
The execution is not allowed because the file is on a filesystem mounted with the "noexec" option. Use
findmnt -u -T .
to find out if that's the case. If you have root privileges,mount -o remount,exec <dir>
should remove this option.The execution is not allowed by MAC policies (SELinux, SMACK, possibly AppArmor). Check the system logs, starting with
journalctl -n 100
anddmesg
. Bypassing this (if you're the administrator) depends on which MAC system is actually in use.
The execution is not allowed because the file is on a filesystem mounted with the "noexec" option. Use
findmnt -u -T .
to find out if that's the case. If you have root privileges,mount -o remount,exec <dir>
should remove this option.The execution is not allowed by MAC policies (SELinux, SMACK, possibly AppArmor). Check the system logs, starting with
journalctl -n 100
anddmesg
. Bypassing this (if you're the administrator) depends on which MAC system is actually in use.
edited 9 hours ago
Moshe Katz
2,2722 gold badges16 silver badges34 bronze badges
2,2722 gold badges16 silver badges34 bronze badges
answered Jun 24 at 21:11
grawitygrawity
253k38 gold badges534 silver badges599 bronze badges
253k38 gold badges534 silver badges599 bronze badges
3
Thank you, in my case it isnoexec
. I got confused, I have this disk mount as/home ext4 auto,exec,rw,async,user 0 2
in/etc/fstab
, why is itnoexec
?
– Henry
Jun 24 at 21:28
6
Because you have theuser
option in there.
– grawity
Jun 25 at 14:15
What is MAC (in this context)? Not MAC address, I presume(?).
– Peter Mortensen
Jun 25 at 22:03
3
Mandatory Access Control
– Dancrumb
Jun 25 at 22:25
add a comment |
3
Thank you, in my case it isnoexec
. I got confused, I have this disk mount as/home ext4 auto,exec,rw,async,user 0 2
in/etc/fstab
, why is itnoexec
?
– Henry
Jun 24 at 21:28
6
Because you have theuser
option in there.
– grawity
Jun 25 at 14:15
What is MAC (in this context)? Not MAC address, I presume(?).
– Peter Mortensen
Jun 25 at 22:03
3
Mandatory Access Control
– Dancrumb
Jun 25 at 22:25
3
3
Thank you, in my case it is
noexec
. I got confused, I have this disk mount as /home ext4 auto,exec,rw,async,user 0 2
in /etc/fstab
, why is it noexec
?– Henry
Jun 24 at 21:28
Thank you, in my case it is
noexec
. I got confused, I have this disk mount as /home ext4 auto,exec,rw,async,user 0 2
in /etc/fstab
, why is it noexec
?– Henry
Jun 24 at 21:28
6
6
Because you have the
user
option in there.– grawity
Jun 25 at 14:15
Because you have the
user
option in there.– grawity
Jun 25 at 14:15
What is MAC (in this context)? Not MAC address, I presume(?).
– Peter Mortensen
Jun 25 at 22:03
What is MAC (in this context)? Not MAC address, I presume(?).
– Peter Mortensen
Jun 25 at 22:03
3
3
Mandatory Access Control
– Dancrumb
Jun 25 at 22:25
Mandatory Access Control
– Dancrumb
Jun 25 at 22:25
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1452496%2fcannot-execute-script-while-its-permission-is-x%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown