I have checked permission and I am the owner of the directory/files. I can't run .sh and can't run an executable which is the result of a compiler, made by another user. But for example I can execute makefiles.
Example
./ install.sh clean
./: permission denied
install.sh calls a make OPT=opt clean, when I type that directly it works.
With the other executable I also get permission denied
Related
I created an Azure ARM template, which is using the Microsoft.Compute/virtualMachines/extensions in an Ubuntu 18.04 in order to execute a custom script. Once the machine is provisioned, the ubuntu user (non-root) should be able to run the custom script from the following directory /var/lib/waagent/custom-script/download/0 it receives "permission denied". I added the following lines to make sure the ubuntu user owns the file and is able to execute, but without success.
sudo chown ubuntu install_metaport.sh
chmod +x install_metaport.sh
sh install_metaport.sh
I then, changed my approach and added the following inline commands to my Azure ARM script, which worked fine. But I am trying to avoid having to copy/move the file around, and have this executed from its original directory, which is /var/lib/waagent/custom-script/download/0, but again, I end up with "permission denied" and can't figure it out how to get around this issue
cp install_metaport.sh /tmp && chown ubuntu /tmp/install_metaport.sh && chmod +x /tmp/install_metaport.sh && cd /tmp && sh install_metaport.sh
Any advise?
Thank you
Your file install_metaport.sh can be executed by user Ubuntu. You verified that by putting in another directory.
The fact that the file can be executed from another directory tells that permissions are denied at a lower level. Root folder permission limits child files permission, so most likely you cannot execute in the /var/lib/waagent/custom-script/download/0 directory. Give the user ubuntu executions rights there, and it'll work like a charm.
I'm trying to init a repo to download the android-x86 source. I've done it before and had no problems.
Today it keeps saying permission denied, i've reset the permissions and owner with chmod and chown, no dice.
[Errno 13] Permission denied
I've tried with and without sudo. I am the only user of the PC but it keeps refusing to init the repo. Is there a way round this without a full reinstall of ubuntu? The permissions system makes no sense to me. I am the only user, I own the folders, I own the files, permissions are set to allow read, write, execute and still I get permission denied errors.
Please help.
I'm running Ubuntu 12.04LTS.
Have unpacked Visual Studio Code in a folder owned by my user id. All vscode files are owned by my user id (user and group).
Have Node.js, npm, typescript installed via apt-get (and npm).
Visual Studio code runs fine, however File->Preferences->Workspace Settings gives this error:
Unable to create 'vscode/settings.json' (Error: EACCES: permission denied, mkdir '/.vscode').
Any ideas on how to resolve this? Where is it trying to do the mkdir?
Thanks,
Bob Wirka
UPDATE: Sudo'd mkdir "/.vscode" (literally at the root level), and chown'd it recursively to my user and group. Voila! Now I can edit the settings.
So, is there a way to tell Visual Studio Code that it shouldn't be trying to use the root folder?
Mentioned in the update by the OP but thought I'll mention it explicitly. You need to change the permissions for the folder. The following command will change the owner of the directory so that you can open it without needing root privileges.
$ sudo chown <user-name> -R <directory-name>
I had same issue on my osx. I was able to solve this issue by change the permission to read and write in project folder.
Simply type
sudo chmod 777 -R <your_app_name_directory>.
This will give all permissions to all users, groups and others for read, write, execute.
-R gives recursively permissions to all nested files folders inside your directory.
If -R is not given then it gives permissions to current directory only, not to other directories inside.
Change the permissions to your folder
sudo chmod ugo+rwx your_folder
I created package.bin file with makeself on CentOS. It was created successfully.However, when i run the bin file on the same machine, i got permission denied error.
I granted 777 and a+x to package.bin file but still got the same error.
makeself --gzip ./target/package ./target/package.bin "package" ./install.sh
Verifying archive integrity... All good.
Uncompressing package.............................
./xxx.bin: line 392: ./install.sh: Permission denied
Try changing the permissions of the installation directory.
chmod -R 777 /target
I got this issue resolved by granting permissions to the original sh scripts before these are placed into the package folder in target.
Had this problem.
makeself.sh ./mysoft mysoft.sh "mysoft description" ./setup.sh
bash mysoft.sh
Verifying archive integrity... 100% All good.
Uncompressing mysoft desc 100%
mysoft.sh: line 577: ./setup.sh: Permission denied
solved with
chmod a-x ./mysoft/setup.sh
I am trying to run Go's executable file after using command go build instead of typing go run filename.go.
I typed go build in the directory where the Golang source file resides. After the executable file had been created, I typed ./filename to run it. Then the terminal displayed a line :
bash : ./filename : Permission denied
I had tried to change the permission of the filename by typing :
chmod u+x filename
But this action doesn't give any effects. The permission denied error still occurs whenever I type ./filename.
Is there another way to build a Golang applications from source code, and then run it from executable file?
All things done well if I do this task in Windows command prompt, after typing go build, the filename.exe is created and there is no any problem when I run it by typing ./filename.exe.
NTFS and FAT have different permission models than Unix. This especially means that there is no executable flag on such a file system. Calling chmod a+x FILE is a no-op. Linux emulates classical Unix permissions on NTFS file systems by setting a mask for each file that contains the would-be permissions.
To fix these problemss, either move executables to a different file system or change the mount flags to use a permission mask that enables the executable-flag (for all files).