Questions tagged [file-permissions]

Most current file systems have methods of administering permissions or access rights for specific users and groups of users. These systems control the ability of the users to view or modify the contents of the filesystem.

Permissions on Unix-like systems are managed in three distinct classes. These classes are known as user, group, and others.

Permissions on Windows systems can be granted to users, groups, computers, or other built-in security principals such as SELF or CREATOR OWNER.

Permissions are generally configured in an Access Control List (ACL, pronounced ackle) with each entry in the list being referred to as an Access Control Entry (ACE).

965 questions
566
votes
6 answers

ssh returns "Bad owner or permissions on ~/.ssh/config"

When I try to ssh to another box, I get this strange error $ ssh hostname Bad owner or permissions on ~/.ssh/config But I made sure that I own and have rw permissions on the file: ls -la ~/.ssh/ total 40K drwx------ 2 robert robert 4.0K Mar 29…
Robert
  • 14,613
  • 4
  • 19
  • 14
234
votes
4 answers

What's the best way of handling permissions for Apache 2's user www-data in /var/www?

Has anyone got a nice solution for handling files in /var/www? We're running Name Based Virtual Hosts and the Apache 2 user is www-data. We've got two regular users & root. So when messing with files in /var/www, rather than having to... chown -R…
Gareth
  • 8,573
  • 13
  • 44
  • 44
193
votes
3 answers

What does a + mean at the end of the permissions from ls -l?

What is the plus sign at the end of the permissions telling me? ls -l total 4 drwxrwxrwx+ 2 benson avahi-autoipd 4096 Jan 27 17:37 docs Here's the context: cat /etc/issue \CentOS release 5.3 (Final) Kernel \r on an \m
bmargulies
  • 2,333
  • 3
  • 17
  • 20
60
votes
2 answers

What Should be the Permissions of Apache SSL Directory, Certificate, and Key?

I have my cert.pem and cert.key files in /etc/apache2/ssl folders. What would be the most secure permissions and ownership of: /etc/apache2/ssl directory /etc/apache2/ssl/cert.pem file /etc/apache2/ssl/cert.key file (Ensuring https:// access…
JP19
40
votes
1 answer

Why can I update a file owned by root using sudo vi, but not append a line to it with sudo echo "Thing" >> file?

I would like to have script that is doing automated migrations of websites from another be able to append Includes to the /etc/httpd/conf.d/vhosts.conf file. However, when I try to use echo to put append a string to the end of the file I get this: $…
Nick Weavers
  • 501
  • 4
  • 8
37
votes
3 answers

Copy a file's owner permissions to group permissions

How can I copy a file's user/owner permissions to it's group permissions? For example if the permissions are 755 I want them to become 775. Clarification: 755 -> 775 123 -> 113 abc -> aac Bonus if I can do this recursively for all files in a…
AnnanFay
  • 610
  • 2
  • 7
  • 13
24
votes
4 answers

OSX mojave: "crontab: tmp/tmp.X: Operation not permitted"

After updating my OSX to Mojave, it seems I am no longer able to edit my crontab. Any attempt to do so results in the error message on the title of this question. I tracked crontab to /private/var/at and the permissions are the same as another…
Joao Encarnacao
  • 343
  • 1
  • 2
  • 4
24
votes
2 answers

How to add a file to a docker container which has no root permissions?

I'm trying to add a file to a Docker image built from the official tomcat image. That image does not seem to have root rights, as I'm logged in as user tomcat if I run bash: docker run -it tomcat /bin/bash tomcat@06359f7cc4db:/usr/local/tomcat$ If…
nyi
  • 350
  • 1
  • 2
  • 7
24
votes
8 answers

Restrict a Linux user to the files he owns

Imagine a server setup of a shared webhosting company where multiple (~100) customers have shell access to a single server. A lot of web "software" recommends to chmod files 0777. I'm nervous about our customers unwisely following these tutorials,…
Phillipp
  • 492
  • 1
  • 3
  • 12
23
votes
1 answer

php script can't access /tmp folder

I have no open_basedir, php can access /etc /usr /proc /home etc… but not /tmp. tmpfs is mount on /tmp (/tmp type tmpfs (rw)) That's also the reason I want to use the /tmp folder. My files are owned by http (user for nginx and php) and readable by…
eephyne
  • 781
  • 1
  • 5
  • 9
23
votes
7 answers

Copy permissions to identical tree on linux / unix

i have a tree of files with correct permission. then i have a (filewise) identical tree (with different file contents tough) with wrong permissions. how can i transfer the permissions layout from one tree to another?
yawniek
  • 375
  • 1
  • 3
  • 10
23
votes
7 answers

What is the most secure way to allow a user read access to a log file?

My application requires read access to /var/log/messages, which belongs to user and group root. What is the minimal exposure level required on /var/log/messages so my application can read it? Presently, my plan is to change the group ownership of…
gAMBOOKa
  • 999
  • 6
  • 19
  • 34
20
votes
5 answers

How to configure PHP CLI on linux ubuntu to run as www-data?

I have a symfony2 application on my ubuntu. Symfony has a plenty of useful console commands (like php app/console cache:clear or php app/console assets:install web). The problem is If I run them as root user the newly generated files will have…
19
votes
6 answers

Copy file permissions from one directory to another

Over the weekend I copied our company data from one hard drive to another larger one. I thought permission would have copied across but they haven't. What is the best (and quickest) way to copy the permission that were originally set onto my new…
Simon Foster
  • 2,622
  • 6
  • 38
  • 55
17
votes
4 answers

chmod: changing permissions of 'myscript.sh' : Operation not permitted

While running the following docker file I am getting "chmod: changing permissions of '/scripts/entrypoint.sh': Operation not permitted" error. FROM sonarqube:7.7-community ADD plugins/* /plugins/ ADD scripts/* /scripts/ ADD conf/* /conf/ ADD bin/*…
1
2 3
64 65