Unable to understand a permission warning in Mac - macos

I have 777 permissions for the app AquaLess installed by MacPorts.
I run
./AquaLess.app
I get
zsh: permission denied: ./AquaLess.app
This is a strange warning, since I have 777 permissions.
How can you use the program installed by MacPorts?

Type open AquaLess.app
A file with .app extension isn't an executable file. It's a directory that contains various resources in ways that Mac OS knows how to open.
You would get the same warning if you tried to execute $HOME.

Or you could run:
$ ./AquaLess.app/Contents/MacOS/AquaLess
Which runs the actual executable within the .app bundle.

Related

Cant run python files on terminal in Mac

Whenever I try python "x".py it says file can't be found
and when I try drag the file into terminal it says permission denied.

Permission denied when trying to run karaf 0.8.1

I downloaded the OpenDaylight Oxygen SR1 Zip file, unzipped the karaf-0.8.1 file, changed my directory to it but when I try to run ./bin/karaf I get:
./bin/karaf: Permission denied
When I try sudo ./bin/karaf I get
sudo: ./bin/karaf: command not found
The weirdest part is that I also have the folder of the previous version, i.e. karaf-0.7.1, in the same Downloads folder and these commands work perfectly fine in there. I would like to use the latest version however. Could anyone help me please?
Edit: Sorry, forgot to mention I'm running it on Mac OS X
On a Unix-like system, you’re better off downloading the tarball: extracting that will give you files with the correct permissions.
In your case, to fix your setup, you need to run
chmod 755 bin/{client,inc,instance,karaf,setenv,set_persistence.sh,shell,start,status,stop}
to restore the permissions as they ship in the tarball.

Operation not permitted and permission denied

My mac version is 10.12.2.
I'm trying to install R studio and a number of other softwares, but it doesn't work. I suspect it's because of permission issues - my mac doesn't allow them to create directories during installing.
~$ pwd
/Users/biona001
~$ mkdir fdsa
mkdir: fdsa: Operation not permitted
but if I'm in a higher director, it says something different
~$ cd ../
Users$ pwd
/Users
Users$ mkdir fdsa
mkdir: fdsa: Permission denied
and if I move into a lower directory, it works
Users$ cd biona001/Documents/
Documents$ mkdir fdsa
Documents$
I googled almost everything without finding anything that worked, including the one where I boot my mac into this weird mode and type some command. I should be the administrator of this mac.
R Studio is installed by dragging the application to your applications folder. It requires R to be installed. R can be installed from a package, so you don't need the command line.
The 'administrator' on the mac, does not have permission to write files or create folders anywhere. It's not a good idea in any case.
If it's absolutely necessary, you must enable 'root' and login as root. But this is not necessary to use R Studio and R.
Enabling root access without knowing exactly what you are doing is a recipe for disaster.
I had the same "operation not permitted" issue on MacOS Sierra.
Looking at the user's home folder in Finder as John Elemans recommended, showed that the home folder was locked. Unchecked the locked checkbox in finder and was able to create a subfolder in the user's home folder via terminal.

Getting permission denied error when running cf command on mac os x

I have installed Cloud Foundry CLI package on my Mac OS X Yosemite. From the terminal interface when I type cf command, I get the following error
FAILED
Error read/writing config: open /Users/viyer/.cf/config.json: permission denied
How do I fix this? I can't find the file config.json.
I found that removing the .cf directory then running the cf cli fixed it
sudo rm -r ~/.cf
cf -h
That was a bit weird, but I solved it by assigning 777 permission to the folder and config.json.
So, sudo chmod 777 .cf/config.json resolved the problem in my case.
Give it a try!
Cheers!
By default, the cf CLI will try to create and write to a directory named .cf in the user's home directory (i.e. ~/.cf). For some reason the user on your machine doesn't have permissions to create and/or write to that directory.
You can work around this problem by setting the CF_HOME environment variable to another directory that the user does have permissions in.
Unfortunately, no amount of changing permissions on my El Capitan would enable cf to access the config.json file in the .cf folder. I created a new folder in my home space ("CLI") and ensured it had the right permissions and set CF_HOME to point to "~/CLI/" . Just creating the new CF_HOME folder and setting CF_HOME in my .bash.profile was insufficient. I then copied the contents of the .cf folder into my new CLI folder. Finally! cf is working!
Oh, this is interesting. CF on this version of OSX will only run from the home directory, it won't run (it won't find config.json) from anything other than root.
Try this command: sudo chmod -R 777 /Users/{username}/.cf
It worked for me on OS X El Capitan.
The config.json need to have read and write permissions, in my case the .cf folder has root as owner and staff as group, my user on my Mac Yosemite is part of the group staff, but still the config.json file has permission set to 600
to fix this problem you should do:
sudo chmod 666 /User/YourUser/.cf/config.json
Also check the permissions of the .cf folder and check if you can read and write. Do something like this: sudo chmod 755 /User/YourUser/.cf
Delete all the .cf folders from your system and try again. This is something which #broomyocymru has already mentioned above. But still felt this might help users who might not be familiar with shell commands

Insecure world writable dir /Users/username in PATH, mode 040777 when running Ruby commands

When I run Ruby commands like gem -v I get this error:
/Users/kristoffer/.rvm/rubies/ruby-1.9.2-p180/bin/gem:4:
warning: Insecure world writable dir
/Users/kristoffer in PATH, mode 040777
1.6.2
First of all I don't understand what this means. /Users/kristoffer is not in my path according to echo $PATH. The result of echo $PATH is:
/Users/kristoffer/.rvm/gems/ruby-1.9.2-p180/bin:/Users/kristoffer/.rvm/gems/ruby-1.9.2-p180#global/bin:/Users/kristoffer/.rvm/rubies/ruby-1.9.2-p180/bin:/Users/kristoffer/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
As you can see, the PATH is pretty clean. Just the default path + what RVM added.
I've seen the other posts similar to this where the recommended way to solve the issue is to run chmod go-w path/to/folder
However, I'm pretty sure that it's a bad idea to make my Home folder non-writeable, right? I've repaired permissions using Disk Utility and it didn't find anything wrong with the permissions on my Home folder.
Any idea of what the problem is and how I can fix it?
Your home folder should only be writable by you, not by anyone else. The reason gem is complaining about this is that you have folders in your PATH that are inside your (insecure) home folder, and that means that anyone who wants to could hack you by renaming/moving your .rvm folder and replacing it with an impostor.
To fix your home folder, run chmod go-w /Users/kristoffer. If there are any other insecure folders on the way to anything in your PATH, you should fix them similarly.
BTW, the reason that Disk Utility didn't repair this is that it only repairs files installed as part of the OS (see Apple's KB article on the subject). There is an option to repair home folder permissions if you boot from the install DVD and run Password Reset from the Utilities menu, but I'm not sure if it resets the permissions themselves or just ownership.
I kept getting this in my prompt.
I couldn't get it quite right with my command prompt but this ended up working.
Recently this just happened to me and it has to do with a bug in upgrading to Mac OSX 10.9.3. Looks like the upgrade changes the permissons to the User folder. Here's an explanation and a fix:
http://derflounder.wordpress.com/2014/05/16/users-folder-being-hidden-with-itunes-11-2-installed-and-find-my-mac-enabled/
chmod 755 /Users/<username>
Should fix the problem...
it says that the directory Users/username is insecure, you can fix that by running
sudo chmod go-w Users/username
I found a solution. Like user2952657, I got this warning with vagrant up after upgrading to OSX 10.9.3. Updating iTunes to 11.2.1 was all I needed to do to get the warning to stop.

Resources