The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [permissions]

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.

Filter by
Sorted by
Tagged with
16
votes
2answers
5k views

rsync: skip files for which I don't have permissions

I'm using rsync -rlptD to copy a directory from another user. There are a few files (I have no way of knowing these in advance) which I don't have permission to copy. Is there a way have rsync ignore ...
15
votes
3answers
18k views

How Do I check Permissions of Root Folder (/ Folder, not /root)?

Is there a way to check the permissions of the root folder, /? I mean the folder's permissions, not its content's (/var, /usr, etc.) permissions? Running ls /.. shows the content's permissions.
15
votes
1answer
24k views

In Linux, is “write” permission equivalent to “execute” for directories?

The execute permission makes sense for files (which include scripts etc.), but when it comes to directories, the write (w) permission works the same way as execute (x), right? Which means, if we are ...
15
votes
2answers
45k views

Why does “chmod 1777” and “chmod 3777” both set the sticky bit?

To set the sticky bit on a directory, why do the commands chmod 1777 and chmod 3777 both work?
15
votes
4answers
43k views

Poweroff or Reboot as normal User

To run the command poweroff or reboot one needs to be super user. Is there anyway I can run this as a normal user? I just don't want to sudo and enter my password every time I reboot or power off.
15
votes
4answers
1k views

Is there a tool to find out the general state of the machine? [closed]

I am longing for a tool for linux that would give me a general idea what is happening on a machine. Example information I am looking for: What daemons are installed (www, db, others) Config locations ...
15
votes
1answer
422 views

Why does ArchLinux keep some users/groups after package uninstallation?

I've noticed that after uninstalling the postgresql package in ArchLinux the postgres user and group are not removed automatically. The same is true for some other packages. Investigating this further,...
15
votes
1answer
51k views

Executing a script in zsh - file permissions

I'm confused about execute file permissions not behaving as I expect. Probably because my expectations are wrong. Anyway: I have a script file, for simplicity is just called s, located in ~/bin. For ...
15
votes
1answer
21k views

Give default write permission to group to any newly created files and folders

Let's say that we have 2 users: a and b, that are both part of group general. I would like that any file or folder that A creates, would have write permission to the group GENERAL. How can I do it? ...
15
votes
1answer
45k views

Minimum file permissions to delete a file [duplicate]

To delete a file in Linux: What minimal permissions do we need to set on it? What minimal permissions do we need to set on its parent directory?
14
votes
3answers
2k views

Is there a file that always exists and a 'normal' user can't lstat it?

I need this for a unit test. There's a function that does lstat on the file path passed as its parameter. I have to trigger the code path where the lstat fails (because the code coverage has to reach ...
14
votes
2answers
4k views

chown removes setuid bit: bug or feature?

Steps to reproduce: germar@host:~$ cd /tmp/ germar@host:/tmp$ touch test && chmod u+s test && ls -la test -rwSr--r-- 1 germar germar 0 Nov 2 20:11 test germar@host:/tmp$ chown germar:...
14
votes
4answers
36k views

What are the world writable directories by default?

In a standard Linux filesystem, which of these common directories are world-writable by default? /tmp /etc /var /proc /bin /boot /.... .... Why are they world-writable? Does that pose a ...
14
votes
3answers
6k views

Who can change the permissions of a file/directory?

I believe (not sure) that the owner of a file/directory and the root user are the only users that are allowed to change the permissions of a file/directory. Am I correct or are there other users that ...
14
votes
2answers
81k views

How to Change Owner of a Directory

EDIT: The problem was that Apple uses permissions to mark backups and prevents you from modifying them (probably a security feature). By using chmod -RN <dir> I removed ACL data from all the ...
14
votes
4answers
51k views

permissions 755 on /home/<user>/

I am wondering why by default my directory /home/<user>/ has permissions set to 755. This allows other users to enter into directories and read files in my home. Is there any legitimate reason ...
14
votes
2answers
21k views

Why can't root on one machine change nfs mounted content from another machine?

On my NFS server, I have the following export defined: #NFS exports Database /shared -alldirs -network=192.168.1 -mask=255.255.255.0 On my NFS client: 192.168.1.7:/shared /shared nfs rw 0 0 ...
14
votes
2answers
53k views

What are the runtime permissions of a cron job?

When a cron job runs with what privilege does it execute? I'm not sure about that. Is it with the same privileges of the user that added it via crontab -e?
14
votes
1answer
1k views

How is file owner and group remembered for an external drive?

I formatted an external hard drive with an ext4 partition and subsequently mounted it. So that I could use the new partition, I did: sudo chown me:me /mount/directory to change the file owner and ...
14
votes
2answers
24k views

Can I allow users to chmod a file not owned by them?

I would like to allow users to chmod a file that is owned by root or some user that is not themselves. I have chmod'ed the file to 777 and I get "operation not permitted". I have added the user to the ...
14
votes
4answers
15k views

Can't read a file although it's in my group and permissions for group read are set

I encounter a strange problem on a unix/linux machine: I'm member of a group, let's call it group A and a certain file (which has a different owner) belongs to group A as well. The permissions of ...
14
votes
2answers
2k views

Why can't I list a directory with read permissions?

I created a directory d and a file f inside it. I then gave myself only read permissions on that directory. I understand this should mean I can list the files (e.g. here), but I can't. will@wrmpb /p/...
13
votes
5answers
11k 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 ?
13
votes
3answers
22k views

Write access without read access

Is it possible for a user to have a write access to a file and not be able to read it? How is it possible? I tried the following commands: debianbox@debian:~/posix/io$ touch filetest debianbox@...
13
votes
3answers
46k views

What does GID mean?

What does GID actually mean? I have Googled it and this is what linux.about.com said: Group identification number for the process. Valid group numbers are given in /etc/group, and in the GID field ...
13
votes
3answers
2k views

Best practice for mounting a Windows partition

I am running a dual boot of Windows and Debian on my Laptop. I use Linux mostly but from time to time I need to access my files in my Windows partition. My Windows partition is mounted as follows at ...
13
votes
3answers
14k views

Back up and restore file permissions

Is there a way to back up and restore file ownership and permissions (the things that can be changed with chown and chmod)? You can do this in Windows using icacls. What about access control lists?
13
votes
4answers
23k views

How to restore default group/user ownership of all files under /var?

I accidentally changed /var owner/group to my username and then changed it back to root, but not all the /var folders' owners are root, so is there anyway to change back owner/group of files/folders ...
13
votes
4answers
11k views

Downsides of umask 077?

What are the cons, for having a restrictive umask of 077? A lot of distros (I believe all, except Red Hat? ) have a default umask of 022, configured in /etc/profile. This seems way too insecure for a ...
13
votes
3answers
52k views

How to check which Apache group I can use for the web server to write?

I'm trying to make Wordpress work. I currently have this error message: Could not create directory. /var/www/html/wp-content/upgrade/theme_name when trying to upload a theme. This is the permissions ...
13
votes
1answer
28k views

Why cannot a user change group ownership of his own files? [duplicate]

Why cannot a user change the group permissions of files which he owns. Let's suppose I have user martin: $ ls -lAd /home/martin/ drwx------ 8 martin martin 4096 Apr 20 01:06 /home/martin/ For some ...
13
votes
1answer
34k 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 ...
13
votes
2answers
8k views

recursively change file permission but not directories?

I was doing a mass recursive change of permissions of some files that I had migrated to a unix system. I changed them to ug+rw, but then I found that I could not traverse subdirectories. I looked at ...
13
votes
3answers
18k views

How to make a folder private?

I'm using Ubuntu with several users and I want to make folders viewable just for a specific user. Any idea how to do it?
13
votes
3answers
4k views

How do I let an SDL app (not running as root) use the console

I want to use an SDL-based program to display graphics on the console, without having to log on from the console, and without running the program as root. For example, I want to be able to run it via ...
13
votes
1answer
2k 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 ...
12
votes
2answers
3k views

Run a binary owned by root without sudo

I had a question on a job interview: How can you execute (run) the program with the user user1 without sudo privileges and without access to the root account: $ whoami user1 $ ls -l ~/...
12
votes
2answers
6k views

Getting “permission denied” when trying to append text onto a file using sudo [duplicate]

I'm using Amazon Linux. I'm trying to append some text onto a file. The file is owned by root. I thought by using "sudo", I could append the needed text, but I'm getting "permission denied", see ...
12
votes
5answers
15k views

Why are files in a smbfs mounted share created with executable bit set?

I mounted a samba share using the smbmount command: $ sudo smbmount \\\\foo\\bar /mnt/bar -o user=tom When I create new files, they get created with the executable bit set for owner, group and ...
12
votes
3answers
3k views

Why is “rm -r” unable to delete this folder?

I have a folder with -wx permissions called folder1 and another folder inside it called folder2 with rwx permissions. I tried to delete folder1 using this command: rm -r folder1 But I got the ...
12
votes
6answers
40k 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 /usr/bin/...
12
votes
3answers
10k views

How to set permissions in /sys/ permanent?

I'm starting X as a user and need to set my keyboard brightness in /sys/class/leds/asus\:\:kbd_backlight/brightness. The /sys/ directory gets recreated after reboot, so the permissions will reset too. ...
12
votes
2answers
8k 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': ...
12
votes
2answers
9k views

rsync doesn't preserve directory ownership even with -a

I use this rsync invocation to backup my home directory: rsync -aARrx --info= --force --delete --info=progress2 -F "$USER_HOME" "$BACKUP_MNTPOINT" rsync man page says that -a implies -g and -o (...
12
votes
2answers
18k views

Why are 666 the default file creation permissions?

As I've found out, when using umask, the highest permissions you can give to files are 666. Which is done by umask 0000. That's because of the default file creation permissions, which appear to be 666 ...
12
votes
1answer
37k views

How are file permissions applied to newly created files?

I have a directory that has the following permissions set: drwxr-s---. user group folder On the desktop, I access this folder and right click to create a new file call foo.txt. Then using the ...
12
votes
1answer
6k views

Symbolic link permissions don't change with chmod

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

Device is Mounting as Read Only (Can Copy Files as Root)

I am attempting to mount my Amazon Kindle, 3rd Edition. It automounts correctly and when I run mount -l, I get the following output: /dev/sdg1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,...
12
votes
1answer
12k views

Find a user's writable files and directories [duplicate]

How can I determine all files and folders that given user can write to? The user is nobody. Some script in bash or python, perhaps? I'm using Ubuntu 11.04
12
votes
1answer
22k 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) groups=16(dialout),...