chown is a command is used to change the owner and/or group membership of a file or set of files.
Questions tagged [chown]
374 questions
117
votes
8 answers
Correct owner/group/permissions for Apache 2 site files/folders under Mac OS X?
It's hard to find Mac-specific answers to this question on the web, so I'm hoping someone out there can put this one to rest for me? My permissions are screwed up on my sites and I'm not sure how to fix them without just slamming a recursive 777 on…

Fo.
- 3,752
- 7
- 28
- 44
111
votes
6 answers
why doesn't chown work in Dockerfile?
My Dockerfile creates a directory, chown's it, and then lists the directory afterwards. The directory is still owned by root. Why is that?
Here is the Dockerfile:
FROM ubuntu:precise
RUN useradd -d /home/testuser -m -s /bin/bash testuser
RUN mkdir…

user100464
- 17,331
- 7
- 32
- 40
89
votes
13 answers
"Command /usr/sbin/chown failed with exit code 1" when Archiving
I am trying to archive my first iOS 4.3 Application for iPhone and I always encounter this error:
Command /usr/sbin/chown failed with exit code 1
I have searched through various forums, trying solutions such as changing the Alternate Install Group…

Justin
- 891
- 1
- 6
- 3
68
votes
4 answers
How to change the user and group permissions for a directory, by name?
os.chown is exactly what I want, but I want to specify the user and group by name, not ID (I don't know what they are). How can I do that?

mpen
- 272,448
- 266
- 850
- 1,236
67
votes
2 answers
chown illegal group name (mac os x)
I'm trying to run the following command in Terminal:
chown -R couchdb:couchdb /usr/local/var/log/couchdb
However, I keep getting this message:
chown: couchdb: illegal group name
I am using mac osx (mountain lion) and I have command line tools…

egon
- 949
- 2
- 7
- 12
64
votes
1 answer
changing the owner of folder in linux
I have a folder in my subdomain which is created through WHM so the owner of that subdomain is not the owner of main domain.
I want to change the owner of one of the folders of subdomain to domain owner. I tried this, but when I check with winscp…

sachin
- 727
- 1
- 5
- 11
52
votes
10 answers
What is the Python way for recursively setting file permissions?
What's the "python way" to recursively set the owner and group to files in a directory? I could just pass a 'chown -R' command to shell, but I feel like I'm missing something obvious.
I'm mucking about with this:
import os
path = "/tmp/foo" …

Geoff
- 573
- 1
- 5
- 7
39
votes
2 answers
MongoDB only works when run as root on Ubuntu - data directory issue
I installed MongoDB with the official packages (mongodb-stable), and followed the Quickstart guide which includes:
By default MongoDB will store data in
/data/db, but it won't automatically
create that directory. To create it,
do:
$ sudo…

YXD
- 31,741
- 15
- 75
- 115
36
votes
5 answers
Trying to get Postgres setup in my environment but can't seem to get permissions to intidb
I'm following the recent RailsCast on setting up PostgreSQL, but I'm unable to run the initdb /usr/local/var/postgres command. Each time I run it, I get this error:
The files belonging to this database system will be owned by user "Construct".
This…

Jimmy Odom
- 395
- 1
- 3
- 5
35
votes
5 answers
.ssh/id_rsa failed: permission denied
I have been scanning the web/SO and read several permission denieds plea's for help I just cant find one that solves my issue in a way i understand.
I'm following these instructions (Getting Started with Python on Heroku/Cedar). Everything went…

Drew Verlee
- 1,880
- 5
- 21
- 30
34
votes
8 answers
Setting read/write permissions on Mongodb folder
I just finished installing MongoDB on OSX and setup a directory structure with sudo mkdir -p /data/db.
When I attempt to run mongod from my user account it returns an error stating that my user account does not have read/write permission to…

Zoltan King
- 1,964
- 4
- 18
- 38
33
votes
3 answers
Linux chown -R parameter, what does it mean
The explanation is:
"-R, --recursive
operate on files and directories recursively"
What does "recursive" mean here?

nomnom
- 1,560
- 5
- 17
- 31
27
votes
5 answers
Why does chown increase size of docker image?
I can't understand why the 'chown' command should increase the size of my docker image?
The following Dockerfile creates an image of size 5.3MB:
FROM alpine:edge
RUN adduser example -D -h /example -s /bin/sh
This example however creates an image of…

Fractalf
- 5,228
- 3
- 23
- 26
24
votes
3 answers
Dockerfile "RUN chmod" not taking effect
Everything else takes effect but permissions are not changing, am I missing something?
FROM joomla:3.9-php7.2-apache
RUN apt-get update \
&& apt-get install -y apt-utils vim curl
COPY ./joomla_html /var/www/html
RUN chmod -R 765…

Maurício Mendonça
- 251
- 1
- 2
- 5
22
votes
5 answers
Access GPIO (/sys/class/gpio) as non-root
The /sys/class/gpio can only be accessed as root by default. So I like that a new group gpio can use the files and directories under /sys/class/gpio. To achieve that I added the following lines to /etc/rc.local (I'm on Debian):
sudo chown root:gpio…

TiMESPLiNTER
- 5,741
- 2
- 28
- 64