Questions tagged [chown]

The chown command is used on Unix-like systems to change the owner of a file.

The chown command is used on Unix-like systems to change the owner/group of a file.

147 questions
77
votes
4 answers

bad ownership or modes for chroot directory component

I created the user MY_USER. Set his home dir to /var/www/RESTRICTED_DIR, which is the path he should be restricted to. Then I edited sshd_config and set: Match user MY_USER ChrootDirectory /var/www/RESTRICTED_DIR Then I restarted ssh. Made…
MultiformeIngegno
  • 1,627
  • 9
  • 24
  • 31
50
votes
9 answers

How to Chown a directory recursively including hidden files or directories

Seems like chown with the recursive flag will not work on hidden directories or files. Is there any simple workaround for that?
toby
  • 601
  • 1
  • 5
  • 6
42
votes
2 answers

Using dot (.) as delimiter to specify group in chown

I've always done: chown nimmylebby:admins file I see that this also works: chown nimmylebby.admins file Might seem like a silly question but I'm genuinely curious on how the latter works. It isn't documented in my chown's manpage (GNU coreutils…
Belmin Fernandez
  • 10,629
  • 26
  • 84
  • 145
40
votes
2 answers

chown on a mounted NFS partition gives "Operation not permitted"

I have a remote partition that i have mounted locally using NFS. 'mount' gives 192.168.3.1:/mnt/storage-pools/ on /pools type nfs (rw,addr=192.168.3.1) On the server i have in exports: /mnt/storage-pools …
Disco
  • 1,301
  • 5
  • 19
  • 34
34
votes
8 answers

Chown operation not permitted for root

I try to chown the owner of a file to root, but I can't. I'm doing this as root. I get the following message: chown: changing ownership of `ps': Operation not permitted
Peter Stuifzand
  • 730
  • 2
  • 8
  • 10
27
votes
8 answers

Accidently ran "chown www-data:www-data / -R" as root

I just ran this a few seconds ago. I managed to do Ctrl - C as soon as I realized what I started doing. So far the only directory it's started going through is /bin. I'm afraid to do anything else. So far I realized I can't use su as my normal user…
Will
  • 441
  • 5
  • 13
11
votes
1 answer

Chown in sudoers file : Safe or not?

Is it safe to add this command in sudoers file? mike ALL= NOPASSWD:/bin/chown -R www-data\:www-data /var/www and this is the only command that I want to run $mike@ubuntu: sudo chown -R www-data:www-data /var/www Thank you.
Mike
  • 125
  • 1
  • 1
  • 6
11
votes
2 answers

Using chown to change the group owner of a directory is not permitted....Why?

I am trying to execute chown on a directory that has the following permissions and owners: drwxrwxr-x 2 justin devs 4096 Jan 1 20:42 test I am trying to simply execute the following as the justin user: chown justin:nginx test So basically just…
Justin
  • 5,008
  • 19
  • 58
  • 82
8
votes
3 answers

chown: changing ownership of `.': Invalid argument

I'm trying to install some new files on our new server while our sysadmin is in holidays: Here is my df # df -h Filesystem Size Used Avail Use% Mounted on /dev/sdb3 273G 11G 248G 5% / tmpfs 48G 260K …
Pierre
  • 429
  • 1
  • 5
  • 14
7
votes
4 answers

How can I chown a file to a subuid without sudo

Basically, What is going on here and what am I not understanding? I have a set of subuids for my user. I want to chown a file to specific subuid which is part of this user's allocation administrator@host:/home/administrator$ cat…
TechnicalChaos
  • 133
  • 1
  • 8
6
votes
3 answers

sshfs permission denied even for root user

I use sshfs to mount a remote folder from another server to the local server. Mounting the remote folder works without a problem using the following command: sshfs -o allow_other someServerFromSSHConfig:/home/data/somefolder/ /some/local/folder The…
Flatron
  • 298
  • 1
  • 5
  • 18
5
votes
3 answers

Fastest way to chown a whole device (xfs)

I need to chown 1.5 million files on a drive. I'm currently doing: sudo chown -R www-data:www-data /root-of-device but it takes an awfully long time to run. I was wondering if there was some sort of superfast low-level way to chown every file on…
Aidan Kane
  • 185
  • 1
  • 1
  • 8
5
votes
4 answers

Recovering from bad chown command

I was going to change the ownership of a directory to apache:apache, but I ended up running: chown -R apache:apache / Bad! Very bad! I knew what was going on when it started saying: chown: changing ownership of `/proc/2694/fd/48': Permission…
Christian
  • 462
  • 5
  • 22
5
votes
5 answers

is it safe to chmod 775/664 with owner www-data:www-data?

To make working with my webserver easiest I am proposing doing something like the following: sudo chown www-data:www-data /var/www -R cd /var/www sudo find . -type f -exec chmod 664 {} \; sudo find . -type d -exec chmod 775 {} \; I have my…
Alex Hadley
  • 151
  • 1
  • 1
  • 5
4
votes
0 answers

Non-root user needing chown capability on NFS client

I am providing an NFS server as part of a collaborative project with another group producing client software over which I have no control. Their software provides file management to its users through a web interface and service, and as a storage…
Drew
  • 83
  • 6
1
2 3
9 10