Score:0

Permission Denied When Running Shell Script

ru flag

I'm using Ubuntu Server 20.04 LTS. When I run a shell script, I get the following error: -bash: ./install.sh: Permission denied. I've looked at a similar post on this forum and none of those answers solved the problem. My terminal input and output are below. If anyone can help, that'd be very appreciated.

wilsont@bzoit:/media/wilsont/disk$ chmod u+r+x install.sh
wilsont@bzoit:/media/wilsont/disk$ ./install.sh
-bash: ./install.sh: Permission denied
hr flag
What type of filesystem is `/media/wilsont/disk` and how is it mounted? Try moving `install.sh` to your home directory and running it from there.
Wilson T. avatar
ru flag
When I try to move the file to home, I get the following error: `mv: cannot create regular file '/home/install.sh': Permission denied`. I'm using this command: `mv ./install.sh /home`
vidarlo avatar
om flag
You probably want to move it to `/home/username`, not `/home`.
Wilson T. avatar
ru flag
After I run it in home, this happens: https://pastebin.com/RzJfRQhe
hr flag
... a wifi driver dated `Novembor, 21 2011` is almost certainly of no use to you now
Score:0
in flag

The file system is probably mounted with noexec option. First identify the partition on which you're executing the script. You can do it using mount command. It'll give a you a list of all mounted partitions and their mount points. Then run this following command sudo mount <partition_path> -o remount,rw,exec. That will remount the partition with with read write and execute permissions set. Then try to execute the same script again.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.