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.

learn more… | top users | synonyms (1)

40
votes
5answers
3k 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 ...
6
votes
2answers
5k views

I added a user to a group, but group permissions on files still have no effect

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 ...
31
votes
3answers
30k 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. ...
81
votes
3answers
28k 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?
21
votes
3answers
11k 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?
31
votes
2answers
12k 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 ...
74
votes
2answers
9k views

Why do we use su - and not just su?

I don't understand why su - is preferred over su to login as root.
12
votes
3answers
4k 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?
5
votes
1answer
143 views

How to allow to run su instantly after I added the user to the appropriate group

I have the su executable with the following permissions: bash-4.2# ls -la /bin/su -rws--s--- 1 root wheel 59930 Sep 14 2012 ./su When I am logged in as a user, not in the wheel group and try to ...
64
votes
1answer
70k 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 ...
21
votes
2answers
12k 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
2k 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 ...
12
votes
2answers
6k 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 ...
2
votes
7answers
3k views

Convert ls -l output format to chmod format

Say I have the following output from ls -l: drwxr-xr-x 2 root root 4096 Apr 7 17:21 foo How can I automatically convert this to the format used by chmod? For example: $ echo drwxr-xr-x | ...
7
votes
2answers
9k views

“rsync: failed to set permissions on …” error with rsync -a or -p option

When I use the -a option as is asked and answered in Preserve the permissions with rsync, I got a lot of "rsync: failed to set permissions on" errors. rsync: failed to set permissions on ...
27
votes
4answers
3k views

How to recover from a chmod -R 000 /bin?

And now I am unable to chmod it back.. or use any of my other system programs. Luckily this is on a VM I've been toying with, but is there any way to resolve this? The system is Ubuntu Server 12.10. ...
14
votes
6answers
3k views

Can root/superuser read my read-protected files?

On shared unix hosting, if I have a file sensitive-data.txt and I issue: chmod 600 sensitive-data.txt Can root user still read my file? Specifically I'm wondering if it's safe to store my password ...
7
votes
2answers
15k 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 ...
4
votes
3answers
273 views

Permission denied to change gid(group) of a file I own

It appears I still miss some things about the way permissions work. I am on a debian 7 system btw. just now I have this file of which I downloaded and it belongs to myuser:myuser, that is both user ...
13
votes
3answers
2k views

How does the sticky bit work?

SUID The sticky bit applied to executable programs flagging the system to keep an image of the program in memory after the program finished running. But I don't know that what it's stored in ...
5
votes
2answers
18k 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 ...
3
votes
1answer
3k 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 ...
3
votes
2answers
879 views

Can't get Wireshark to run as user on CentOS

It's the first time I'm installing and configuring Wireshark in a rpm-based distro. In the past I've installed it properly on Ubuntu, Mint or Debian. Don't know why, but it seems I cannot run it as ...
7
votes
1answer
443 views

What does a dot after the file permission bits mean?

I performed an ls -la on directory on my CentOS 6.4 server here and the permissions for a given file came out as: -rwxr-xr-x. I understand what -rwxr-xr-x means, what I don't understand is the . ...
7
votes
4answers
1k 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. ...
6
votes
1answer
4k views

Cannot delete a file - permission denied - why?

[db2inst1][testing ~/sqllib/db2dump] rm db2diag.log rm: cannot remove `db2diag.log': Permission denied [db2inst1][testing ~/sqllib/db2dump] id uid=1002(db2inst1) gid=107(db2iadm1) ...
5
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 ...
100
votes
6answers
6k views

How to chmod without /usr/bin/chmod?

Today I was told a tale by a Unix trainer, a tale where the root password got leaked to the students, and one of the fellas removed the execute permission from /usr/bin/chmod itself. How do you ...
33
votes
3answers
1k views

How does vim steal root owned files?

Witness the following: sh-3.2$ mkdir testcase sh-3.2$ cd testcase sh-3.2$ sudo touch temp sh-3.2$ ls -al total 0 drwxr-xr-x 3 glen staff 102 19 Dec 12:38 . drwxr-xr-x 12 glen staff 408 19 Dec ...
14
votes
3answers
6k views

Is there any way to prevent deletion of certain files from user owned directory?

Let's say user has Directory1 and it contains File1 File2 CantBeDeletedFile How to make so the user would never be allowed to delete the CantBeDeletedFile? If I change the ownership of Directory1 and ...
9
votes
1answer
11k 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, ...
5
votes
3answers
4k views

Allow a user to read some other users' home directories

I am new to system administration and I have a permission related query. I have a group called administration. Inside the administration group, I have the users user1, user2, user3, superuser. All the ...
12
votes
1answer
601 views

Can I restrict a user to use special programs?

Is it possible to add a user and restrict him to run special programs? For example after this user logs in, he can only open Firefox to use Internet and no other programs can be run by this user. For ...
9
votes
5answers
2k 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 ?
6
votes
3answers
10k 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
3answers
3k 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 ...
6
votes
1answer
2k 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 ...
6
votes
1answer
3k views

Symbolic link permissions

I have access to a remote Linux machine where everytime I create a symbolic link, it is created by default with the following permissions: lrwxrwxrwx If I try to change the permissions of the ...
5
votes
2answers
2k views

ISO file readonly?

I have an ISO file and I mount it under /mnt/isofile. Then I copied this file to another folder. But the contents are read-only and belonged to root. I tried to use chmod and chown. But it prompts ...
5
votes
3answers
460 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?
4
votes
2answers
842 views

Getting new files to inherit group permissions on Linux

I am having a problem with permissions on a Linux server. I am used to BSD. When a directory is owned by a group the user who owns it isn't in such as www-data, files created in it will be owned by ...
4
votes
3answers
1k 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: ...
2
votes
2answers
8k 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
4answers
282 views

USB 500GB external drive mounted with undetermined permissions, missing data

Note: This situation is evolving. Please see the output at the end of this question for the current situation. I'm using Linux Mint 14. Recently, I repartitioned one of my hard drives, and I backed ...
0
votes
2answers
157 views

setfacl access issues

I have a list of users (user1,user2,user3,superuser). user1, user2 and user3 belong to a usergroup called normalusers . Now, I need to issue the access control list command for the user superuser to ...
6
votes
1answer
4k views

Group within group file permissions

I tried finding this on here, but couldn't so sorry if it's a duplicate. Say I have 2 groups and a user: group1, group2, user1 with the following structure: group1 is a member of group 2, user1 is a ...
4
votes
3answers
246 views

granting write permissions to a group to a folder

How can I grant write permission to 1 group ? I have 2 users (alex and ben). alex is member of group alex and of group consult. ben is member of group ben and of group consult. I want to grant read ...
4
votes
2answers
4k 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
738 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
362 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 ...