Permissions are the unix way of controlling access to resources such as files, directories and devices and may be specified for an owner, group, or all users.
23
votes
4answers
2k views
Redirecting stdout to a file you don't have write permission on
When you attempt to modify a file without having write permissions on it, you get an error:
> touch /tmp/foo && sudo chown root /tmp/foo
> echo test > /tmp/foo
zsh: permission ...
8
votes
3answers
6k views
Make all new files in a directory accessible to a group
Suppose I have two users A and B and a group G and a folder foo, both users are members of G (using linux and ext3).
If I save as user A a file under foo, the permissions are: -rw-r--r-- A A. ...
44
votes
3answers
10k views
Why do directories need the executable (X) permission to be opened?
In my CMS, I noticed that directories need the executable bit (+x) set for the user to open them. Why is the execute permission required to read a directory?
24
votes
2answers
4k views
Why can rm remove read-only files?
If I create a file and then change its permissions to 444 (read-only), how come rm can remove it?
If I do this:
echo test > test.txt
chmod 444 test.txt
rm test.txt
...rm will ask if I want to ...
8
votes
2answers
2k views
How to apply changes of newly added user groups without needing to reboot?
Assume I'm logged in with user takpar:
takpar@skyspace:/$
As root, I've added takpar as a member of group webdev using:
# usermod -a -G webdev takpar
But it seems it has not been applied. because ...
4
votes
2answers
3k views
How to add write permissions for a group?
I changed permissions of a file (chmod g+w testfile) and running ls -l testfile gives:
-rwxrwxr-x 1 user1 user1 0 2011-01-24 20:36 testfile
I then added a user to that group ("/etc/group" has ...
57
votes
2answers
5k views
Why do we use su - and not just su?
I don't understand why su - is preferred over su to login as root.
11
votes
2answers
4k views
Do the parent directory's permissions matter when accessing a subdirectory?
If I have a root folder with some restrictive permission, let's say 600, and if the child folders/files have 777 permission will everybody be able to read/write/execute the child file even though the ...
13
votes
3answers
3k views
Why can't a normal user `chown` a file?
Why is the chown command root-only?
Why can't non-root users use chown to give away files they own?
47
votes
2answers
36k views
How to set default file permissions for all folders/files in a directory?
I want to set a folder such that anything created within it (directories, files) inherit default permissions and group.
Lets call the group "media". And also, the folders/files created within the ...
11
votes
3answers
1k views
I accidentally chmod -R +x on a directory. How do I restore the correct permissions?
Well, to be specific, it was chmod -R 755. Now every file is executable, which I don't want.
I am thinking that I should look at the first two bytes of each file for the #!, but will this cover ...
10
votes
4answers
2k views
Wrongly set chmod / 777. Problems?
I was trying to run chmod -R 777 ./ but ended up typing chmod -R 777 / and set 777 on my entire machine. What can go wrong? How can I fix it?
6
votes
3answers
992 views
sudo permission denied but su grants permission
this is the first occurrence where su was required for me.
I read an article about changing the value in /sys/devices/virtual/backlight/acpi_video0/brightness to alter my laptop's screen brightness.
...
3
votes
2answers
5k views
SSH and home directory permissions
It took me hours to solve this SSH problem with one of my class accounts on my school's servers.
I couldn't ssh into one particular class account without entering my password, while passwordless ...
3
votes
2answers
1k views
Permissions: What's the right way to give Apache more user permissions?
Context: I am making an in-browser control panel that gives me one button access to a library of scripts (.sh and .php) that I've written to process various kinds of data for a project. It's a "one ...
5
votes
1answer
6k views
How to (safely) move /tmp to a different volume?
Today the /tmp directory filled up on a machine at work. The problem was, it was on the root partition which wasn't very big. In order to fix this, a co-worker created a /new/tmp directory elsewhere, ...
8
votes
4answers
1k views
How to create a file even root user can't delete it
How to create a file even root user can't delete it ?
2
votes
1answer
1k views
In Linux, “Write” Permission Is Equivalent To “Execute” For Directories?
The Execute permission makes sense for files (which include scripts etc), but when it comes to directories, write (w) permission works the same way as execute (x), right? Which means, if we are giving ...
4
votes
3answers
813 views
Permissions issues for shared directory on a server
The setup is we have a VPS running Debian Squeeze, and I've set up a shared directory for us to share files. So far I've followed this guide:
...
4
votes
1answer
748 views
Evince fails to start because it cannot read .Xauthority
I'm logged in remotely over SSH with X forwarding to a machine running Ubuntu 10.04 (lucid). Most X11 applications (e.g. xterm, gnome-terminal) work fine. But Evince does not start. It seems unable to ...
3
votes
1answer
242 views
Can't rename a directory that I own
I have a directory with a big load of sub directories. I own all of them, and the permissions are all 777.
pascal@azazel /box $ ls -al
total 147872
drwxr-xr-x 293 root root 12288 aoĆ» 22 19:44 ...
2
votes
4answers
255 views
Strange file ownership with Ubuntu
Normally we know when we create one file in Linux, the file's owner and group will set with the creator. For example, I have one user, usera, after I execute
usera@srv1:$touch 1.txt
I will find the ...
2
votes
2answers
748 views
can't change file permission
Whenever I create or copy few shell files to usb storage device, then I am not able to make them executable.
If I create test.sh, it's default file permission will be 644, but when I execute
...
2
votes
2answers
680 views
Mount permissions always blocked
How do I authorise my non-root user to manually mount/unmount ALL media on my desktop. I always get denied permission.
Media refers to all mountable USB devices and other partitions on my HDD as ...
2
votes
1answer
434 views
pure-ftpd permission denied on external usb drive
I have a sheevaplug PC (Debian installed) that I'm trying to setup my personal FTP server with. So far I was able to set up auto mounting and installed pure-ftpd. I currently have autofs setup to ...
1
vote
2answers
1k views
Mount device with r/w access to specific user
How can I mount some device with read-write access to specific user?
1
vote
2answers
595 views
newgrp and groups assigned via pam_group.so
For convenience reasons I tend to assign special group memberships like floppy, audio, plugdev, video etc. via /etc/security/group.conf (pam_group.so) mechanism instead of adding all users to this ...
16
votes
3answers
2k views
Clone ownership and permissions from another file?
Is there a command or flag to clone the user/group ownership and permissions on a file from another file? To make the perms and ownership exactly "like" that of another file?
18
votes
4answers
830 views
Is there a reason why 'owner' permissions exist? Aren't group permissions enough?
I think I rather understand how file permissions work in linux. However, I don't really understand why they are split into three levels and not into two.
I'd like the following issues answered:
Is ...
12
votes
3answers
2k views
How to “jail” a process without being root?
Were I root, I could simply create a dummy user/group, set file permissions accordingly and execute the process as that user. However I am not, so is there any way to achieve this without being root?
7
votes
5answers
1k views
Directory with +x permission, parents without it. When would this be useful?
Say I have a folder called folder in the following path:
my_path = /a/b/c/d/e/folder
and a file called file in that folder.
Then, say I run this command to remove group permissions under /a/
> ...
4
votes
2answers
10k views
How to add a ssh user who only has permissions to access specific folder?
How to add an ssh user who only has permissions to access specific folder?
useradd -d /var/www/xyz.com.tr/musteri -s /bin/bash -g sshd musteri
I created a user called musteri. I set its home ...
4
votes
2answers
6k views
How to get back sudo on Ubuntu?
I have done this:
sudo chown -R myname /usr/
and now I can't use the sudo command because of this error:
sudo: must be setuid root
And as I read this means that the owner of this file ...
2
votes
1answer
519 views
How do I restore default owner of files in /var/ directory?
Accidentally in /var/ directory I ran chown root . -R;chgrp root . -R. Now services like mysql don't start. Is there a way to restore default owner and groups?
If there is no way, what is the default ...
6
votes
2answers
2k views
I can't delete a file that I have write permissions for as a group member
$ touch testfile
$ chmod g+w testfile
$ sudo adduser user2 user1
$ stat -c'%a %A' testfile
664 -rw-rw-r--
$ su user2
Password:
$ groups
user2 user1
$ rm testfile
rm: cannot remove `testfile': ...
3
votes
1answer
11k views
VSFTPD, 553 Could not create file. - permissions?
I've set up VSFTPD on Amazon EC2, with the Amazon Linux AMI. I created a user and can now succesfully connect via ftp. However, if I try to upload something I get the error message "553 Could not ...
3
votes
3answers
9k views
“Symbolic link not allowed or link target not accessible” / Apache on CentOS 6
I've got a brand new CentOS 6 installation, which has a symlink in the document root to my development files:
[root@localhost html]# ls -l
total 4
-rwxrwxrwx. 1 root root 0 Sep 18 20:16 index.html
...
3
votes
2answers
248 views
Permissions of webserver's root directory
I've had this issue on several setups, and I'm unsure of how to handle it.
At first, all of /var is owned by root:root. Clearly I don't want the web directory to be owned by root, so I do chown ...
3
votes
3answers
370 views
Unix users, groups, and permissions
I don't understand unix users, groups, permissions, etc. For example, things managed by the chmod, chgrp, usermod, groupadd, etc. commands. How do all these things work?
2
votes
3answers
920 views
read only access to all files in a specific sub-folder
I have got a specific folder located in "/home/.../reboot/". I have a series of users that require read-only access to the ever changing files within. My problem is that the same users are not ...
2
votes
1answer
567 views
NAS box mounted via CIFS - problem with permissions
I'm running the latest version of Ubuntu, and have mounted a SMB share via a line in rc.local.
The share mounts correctly, and I can browse files freely, create new files, and then delete them ...
2
votes
1answer
533 views
How to assign correct permissions to both webserver and svn?
I've an issue with files ownerships in unix.
I have a drupal website and the "files" folder needs to be owned by "www-data" in order to let the users to upload files with php.
However I'm now using ...
1
vote
1answer
97 views
Shared partition permission management
I am willing to try a dual boot arch/lmde setup on my laptop next week, but I've ran into a problem: I want to have a shared data storage where my downloads, documents etc would reside and could be ...
6
votes
3answers
944 views
How to revert chown command?
If I run:
sudo chown -R user:user /
Can I revert it to what it was before I ran it?
5
votes
1answer
2k views
Unable to delete file, even when running as root
I am in the process of migrating a machine from RHEL 4 to 5. Rather than actually do an upgrade we have created a new VM (both machines are in a cloud) and I am in the process of copying across data ...
5
votes
5answers
172 views
Changing Unix group for files
I have a file that a colleague and I are editing together, on a Unix system. We are using Unix group permissions to edit it. We have one Unix group that we are both members of. Whenever I save the ...
3
votes
2answers
82 views
Using setfacl to allow group members to write to any file in a directory
I'd like to use setfacl so that anyone in group 'app' can edit any file contained within /usr/local/users/app regardless of what the traditional UNIX permissions say. I have two users john and ben. I ...
3
votes
1answer
345 views
How to configure permissions to allow apache to securely have access to a file in a shared environment?
This is a follow up question from my previous, but I felt it might be more Linux based.
http://serverfault.com/questions/414207/how-to-set-linux-permissions-to-allow-apache-to-have-access-to-a-file
...
3
votes
2answers
268 views
A question about permissions of hierarchical directories
I have some directories, with following permissions:
drwxr-xr-x 18 user1 root 4096 Oct 27 11:25 /home/test1/test2
drwxr-xr-x 24 user1 root 4096 Oct 21 08:38 /home/test1
drwxr-xr-x 492 root root 12288 ...
3
votes
3answers
227 views
Setting execution right to whole directory - is it good or bad idea?
I have a zip file containing lot of files and directories for a certain application which should be running on Linux. Some files needs to be set as executable, but the zip file format afaik does not ...