Bash permission denied in cygwin - linux

I have a directory:
drw-rwxrw-+ 1 username Domain Users 0 Feb 11 09:32 webapp
But when I try to enter this one I get
-bash: cd: /cygdrive/c/dp-project/.../web-app Permission denied
What's wrong? I setted all permissions to all users.

No you didn't "setted all permissions to all users". Execution permission is only set for group. try to chmod a+x webapp.
One othe thing first line webapp second line web-app that is not the same.

The plus (+) sign a the end of the permissions indicates that the file or directory has access control lists set. use:
getfacl /path/to/dir
to read all those acls. Most probably your user or groups access is prevented.

Related

Permission Denied when trying to read file w/644 permission

I am trying to write a PHP script for a Web server (lighttpd) to read a file in another user.
The Web server runs under user http:
http 1929 336 0 Nov20 /usr/bin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
The file the script is trying to read has the following permissions:
-rw-r--r-- 1 pi www-data 721 Oct 30 05:20 /home/pi/bmSunday
Which I thought meant that any user can read it.
The fopen in the script results in a Permission denied:
Warning: fopen(/home/pi/bmSunday): failed to open stream: Permission denied in /srv/http/p1/index.php
I am running Arch Linux.
uname -r
displays:
4.4.32-2-ARCH
What permissions do I need to set on the file so that user http is allowed to read it?
By the way, am I correct in assuming I can also test the permission via:
sudo -u http cat /home/pi/bmSunday
Using the above command, the result is:
cat: /home/pi/bmSunday: Permission denied
The permissions on the directory are probably wrong, http probably doesn't have execute permission. Add world execute permissions:
chmod o+x /home/pi
You (as a user) in your example have no execute permissions. So yes chmod +x file. Keep in mind this adds execute to both users others.
If you give all other user execute permission on home directory of other users it compromise security to all other user. it will be better if you give permission only http user by acl.
$ setfacl -m u:http:r-x /home/pi

mkdir: cannot create directory `pgsql': Permission denied

I want to create directory like below:
ajs#ajs-HP-Compaq-dc5800-Small-Form-Factor:/usr/local$ mkdir pgsql
mkdir: cannot create directory `pgsql': Permission denied
But I am getting error:
Permission denied
How can I resolve and create directory pgsql in this location /usr/local$
Kindly suggest me, hope for reply.
Thanks
You have to check your user name to have permission for creating directory in the folder /usr/local$
Check your permission for the folder by the command
ls -ltr /usr
Link to refer about file permissions.
You are getting a Permission denied error because you do not have access rights to create a directory in /usr/local. You can determine the access rights for these directories by using the stat command. The output will look something like this.
$> stat -c '%n %A %G %U' /usr /usr/local
/usr drwxr-xr-x root root
/usr/local drwxr-xr-x root root
Now double check who you are. You can use the whoami command or the id command invoked below twice to reveal both username and group.
$> id -un; id -gn
In the stat output, root:root owns both /usr and /usr/local and only the owner may create (write) new directories based on the access rights. In order to create the directories, I'd recommend either becoming root or trying the command with sudo. If this is not possible, I'm afraid you'll have to create the directory elsewhere or contact the administrator of that machine.
You probably have to be root to do such things in /usr/local.

File read permissions for 'others' not working

I'm trying to give read permissions to lighttpd access logfiles to normal users which are on the same system.
The permissions are currently:
-rw-r--r-- 1 www-data www-data 211K Feb 28 11:27 /var/log/lighttpd/access.log
So, if I understood correctly others have read permissions. Unfortunately this doesn't seem to work. If I try to read this file with an user account I get:
/var/log/lighttpd/access.log: Permission denied
I already tried to add the user to the group www-data which didn't work as well.
Any hints what I'm doing wrong here?
To access a file, the system needs the execute permission on all the directories containing the file.
In this case it was necessary to issue the chmod o+x /var/log/lighthttps command (after making sure that the user belongs to the "other" part of the permission set).
The "execute" permission for a directory allows you to enter it. The "read" permission for the directory allows you to see the names of the files inside. The interesting thing is that you can give the x permission alone, what means that anyone can access the files inside, but he needs to know its names.
You might not have execute permission for the lighthttpd so the directory does not give the permission to access its containing file.
Use the command to set the execute permission to that directory.
chmod +x /var/log/lighthttpd

permissions issue accessing a file

I log in as root and I issue the following command:
ls -l /home/osr/public_html/include/connect.php
and I receive
-rwxrwxr-x 1 osr epanagio 578 Jul 10 2012 /home/osr/public_html/cti/include/connect_to_md5.php
This tells me that "osr" and "epanagio" can access the file for read-write-execute.
Now I log in as "epanagio" and I issue the same command:
ls -l /home/osr/public_html/include/connect.php
and I receive
/bin/ls: cannot access /home/osr/public_html/include/connect.php: Permission denied
WHAT?! I am "epanagio" and according to the permissions I have rwx to this file.
I am using CentOS and I am obvioulsy lost.
Can someone PLEASE explain this to me?
Just because you have the rights to read a file doesn't mean you can actually REACH that file. You need permissions to access all of the parent directories of wherever that file is.
Consider it the equivalent of giving you permissions take a $1 bill from me, but that $1 bill is inside a safety deposit box in a bank's vault. You have the rights to the money, but no rights to walk into the vault and open the box.

ant Permission Denied problem

After extracting and saving the ant files into an opt/ directory and setting the path variable
to $ANT_HOME/bin
I ran the following command on a CentOS 5
ant -version
and I am getting the following error
-bash:/path/opt/apache-ant-1.8.2/bin/ant: Permission denied
Is there some permission I am supposed to set or some typical source of this problem?
Thanks!
If you own the file, try
chmod u+x /path/opt/apache-ant-1.8.2/bin/ant
If someone else owns it, either sudo or become root then
chmod 755 /path/opt/apache-ant-1.8.2/bin/ant
You need to have execute permissions on the file; the first gives execute permissions to the owner only and is probably preferable if you own the file and are the only one that uses it. The second requires root privileges and gives execute and read permission to everyone, plus write permission to the owner.
You can view the current permissions and ownership of the file by running ls -l /path/opt/apache-ant-1.8.2/bin/ant.

Resources