Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [chown]

All about changing ownership of files.

2
votes
1answer
49 views

Why can't I chown a pipe? [closed]

From a discussion on useless use of cat. I decided to see if It was possible to avoid some of the troubles by changing the owner of the pipe. So I did: # cat | cat & [1] 16500 # cd /proc/16500/...
1
vote
1answer
27 views

Allow non-root user to change group for it's own files

My server at home uses rsync to backup files to my VPS, but I have an issue with setting the group property for uploaded files. Because the rsync uploads the data to a folder which can also be ...
4
votes
1answer
42 views

Changing default USB drive mountpoint owner

I am developing a device that runs Raspbian on Raspberry Pi. The device runs a background process that should be able to access usb drives when they are plugged in. The problem is that the background ...
6
votes
2answers
508 views

Can't remove a file with file mode bits a+rw

I have a file with the following file mode bits (a+rw): [0] mypc<johndoe>:~>sudo touch /tmp/test [0] mypc<johndoe>:~>sudo chmod a+rw /tmp/test [0] mypc<johndoe>:~>ls -l ...
0
votes
0answers
33 views

Access permissions for google-compute-engine script

I would like to run a python script on compute engine, which uses a Linux-based operating system ("debian-9-stretch-v20180307"). I am using a bash boot script with code as follows: #! /bin/bash ...
0
votes
0answers
43 views

mount failing when mounting ewf1 as a loop device

I am trying to mount an EWF image on Debian. From the original E01 format, I used ewfmount to mount it and it worked fine. Now, I need to mount the ewf1 file, and it claims that I do not have the ...
4
votes
2answers
1k views

chown: missing operand after ‘root:users’

I try to change owner to root:users recursively below a directory, if owner is other than root:users. cd /dir/ find . \( ! -user root -o ! -group users \) -print0 | xargs -0 chown -vc root:users I ...
1
vote
3answers
66 views

Revert changed ownership of files under /usr, Void Linux

Having lost my mind I did chown -R root:root /usr on a Void Linux system Would someone be so nice as to mail me the results of ls -lR /usr on a Void system. I'll go over the changes, make everything ...
1
vote
3answers
443 views

what is chown root:root doing?

I read a tutorial and was instructed to do chown root:root /home/mynewuser as part of the process to get my ssh key working with a new user i created "kevind", however it broke the path. What does ...
0
votes
1answer
86 views

No permission to chown /mnt/hdd

I don't have permission to chown the mounted directory /mnt/hdd. I am currently logged in as root. The ls -l output is: rwxrwxrwx 1 root root 131072 Jan 1 1970 hdd I am mounting it via fstab ...
0
votes
1answer
443 views

can not set user write permissions to file in SMB mounted directory [duplicate]

I have mounted a Windows 10 directory so I can edit some files on my Windownz machine. sudo mount -t cifds //W10/Users ~/public/ -o username=bobby When checking the directories they all have the ...
0
votes
1answer
986 views

SSH configuration: chown username:group: says invalid user

My Ubuntu16.04.4 server has username: graycodes THE ERROR OUTPUT: chown: invalid user: 'vagrant:vagrant' I'm setting file permissions for OpenSSH. What I'd like is to keep my username as ...
5
votes
1answer
231 views

Can't chown 0 (root) in Cygwin

This command: rm -f testfile && touch testfile && chown 0 testfile is failing in Cygwin with error: chown: changing ownership of 'testfile': Invalid argument Why?
0
votes
1answer
154 views

Change File Permission at run time

I have two users in a group. Users: 1) apache 2) data Group 1) apache I have three directories. The directory structure of that three directories are like below. drwxrwx--- 10 data ...
0
votes
1answer
216 views

Why is there a chgrp command if there is chown [duplicate]

After working 15 years with Linux, I stumbled upon the command chgrp. Until now, I always used chown to change the ownership of a file, even if I only changed the group; for example chown :www-data ...
0
votes
0answers
16 views

How do I find out what changed a file's user or group or permissions? [duplicate]

Something on our server is changing the user or group or permissions of certain files, and I'm not sure how to find out what's doing it. It seems to be random and our testing has not found out, and I'...
18
votes
3answers
4k views

How fakeroot is not a security breach in Linux?

After reading some pretty nice answers from this question, I am still fuzzy on why you would want to pretend that you are root without getting any of the benefits of actually being root. So far, what ...
1
vote
3answers
636 views

How to set the future permissions of content in folder

Let's say I am the user Alice and I have a publicly accessible folder /samba/public The permissions of the public Samba folder (/samba/public/) are nobody:nogroup and 0777. When Alice tries to copy ...
1
vote
2answers
180 views

What is the application of file ownership (chown) in linux?

I have faced a problem in changing the permissions for a specific group of users in my system. suppose I have four users u1,v1 and u2,v2 and two groups g1 and g2. u1,v1 are in g1 group and u2,v2 are ...
0
votes
1answer
213 views

chown a folder on host with a user that only exists inside a docker container

So, basically, I have a docker container running and i have mounted a host file-system inside the container so that the processes inside can have access to its files. The running process inside the ...
2
votes
2answers
48 views

How do I change the ownership of files within current directory, sub-directories, and sub-directories of sub-directories?

I want to make the files in the current directory, sub-directories, and sub-directories within the sub-directories. Eg. Pretend my file structure is as follow | +-A + 1.file +-B + 2.file ...
0
votes
1answer
29 views

Providing read only access to users from another group to a folder belonging to the home directory of a user from different group

So I have got two groups fruits and vegetables. mango is a user belonging to fruits group. There's a folder named insecticide in the home directory of mango. I want to provide read-only access to the ...
0
votes
1answer
914 views

Include password when mounting a drive using cifs

At first I using this to mount a shared drive: sudo mount -t cifs -o username=myuser //xxx.xxx.xx.xx/myfolder /mnt/windowsshare/ but then I didn't have modify access or ownership to the shared drive ...
1
vote
2answers
306 views

scp file to server with user different than ssh login

I need to copy file somefile.jar from local computer (cygwin) to remote server.local. I have an ssh login corp to server.local that a sudoer on server.local. I need to place the file to folder /opt/...
1
vote
1answer
2k views

Change ownership of a share drive

I have a windows machine locally connected to my linux machine. There is a shared folder on the windows machine, which I mounted on my linux machine using sudo mount -t cifs -o username=myuser //xxx....
0
votes
1answer
59 views

prevent current user from reading his own file

Edit: The short question is: How do I give away access to files that my (non-priviledged) user currently owns. I would like to be unable to get access to them in any way. Please see the rest of the ...
5
votes
3answers
1k views

How to add a second owner of a folder using terminal on Mac?

On Mac using terminal and "chown" command I can set owner for a folder like this: sudo chown -R _www somefolder However this replaces me with _www. I.e. I'm not in the list of owners anymore. I ...
0
votes
2answers
399 views

chown does not give me any right

I have a folder, my-folder. From its parent directory, I first do: sudo chown -cR matthewslouismarie: my-folder If I then do: chmod -cR 600 my-folder, I get: chmod: cannot access 'my-folder/build....
0
votes
1answer
98 views

Permission automatically resets to root after using chown

I've got a samba shared directory which previously was setup normally but I noticed not being able to connect to it anymore. Turns out that permissions were reset to root and whenever I try to change ...
14
votes
2answers
10k views

Is it possible to chown a file, based on numeric UID, to a user that does not yet exist?

For example, for managing a disk partition for another system where the user exists. I know I can simply create a user temporarily but I find this question interesting.
0
votes
1answer
261 views

How to change the owner and group of a directory by the name of that directory?

I have a Ubuntu 16.04 Nginx server environment with several CMS (WordPress) websites under document root. All the site directories have www-data as owner and group, recursively. According to some ...
3
votes
3answers
1k views

Restore file ownership after running chown by accident

Update 1: I applied chown -R gdm:gdm /var/lib/gdm and am now able to log in successfully! However, I don't know the extent to which this will cause problems. -- I recently upgraded my postgresql ...
3
votes
0answers
380 views

owner/group getting set to `82`

Here's a real weird one for ya. :D The Issue I am running a Lando dev environment on a simple dummy LAMP application, as a way to test my custom Lando plugin (working off the console branch). (Lando ...
1
vote
0answers
67 views

Just recursively changed the ownership of “/” to my own user by accident. How screwed am I? [duplicate]

Was messing around with an external drive and wanted to change the permissions of a folder. However, I accidentally ran sudo chown myuser -r /. I have never felt so dumb in my life. I immediately ...
-1
votes
1answer
94 views

Is “install” a shortcut for cp + chown + chmod, or does it do more?

I read man install, and it seems that it just copies files with ownership & mode. So, is install a shortcut for cp + chown + chmod, or does it do more, under the hood?
2
votes
1answer
11k views

How are chown and chmod command different in the given operation?

If I change the ownership of the contents of a file and further set permissions to the content of the file, how exactly are both the operations different? For example, if I change the ownership of ...
2
votes
1answer
492 views

How come I, as a normal user, am able to change ownership of a file?

I have a partition that's NFS-mounted from a Netapp SAN. I can create files in that partition, and I can chown those files to another user, any user, even root. How am I able to do so? I thought the ...
0
votes
1answer
70 views

Prevent deleting files in particular directory

Recently, I deleted some files accidentally. Fortunately, I was able to recover them. That is why I would like to prevent deleting files in a particular directory but still allow to create new files ...
0
votes
0answers
248 views

SETUID and SETGID Behavior

The setup: ~$ ls -l /etc/sudoers -r--r----- 1 root root 614 2017-09-10 20:29 /etc/sudoers ~$ ls -l /etc/shadow -rw-r----- 1 root shadow 794 2011-04-18 11:49 /etc/shadow $ ls -l $(which ht) -rwsr-sr-...
2
votes
1answer
2k views

chown not working in mounted partition

I'm using Fedora 24 and I have two partitions. I login as user and mount the second partition by clicking on it on the file manager. A window pops up asking for my password so I'm assuming the mount ...
1
vote
2answers
338 views

How to call chmod and preserve the SGID bit?

I have the following directory structure: + public/ |-+ pics/ | |-- a | `-- b `-+ thumbs/ |-- a `-- b I would like all the files in the tree to be owned by gallery:http with ug=rwX,o= mode set. ...
0
votes
0answers
53 views

NPM chown does not work as advertised

This is supposedly supposed to work sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share} according to this article https://docs.npmjs.com/getting-started/fixing-npm-...
7
votes
1answer
11k views

How to perform chown and chgrp in one command

In order to change both a file's owner and group we can do this: chown trump file chgrp trump file but can I do both commands in one approach or one command?
0
votes
3answers
1k views

How to change the user name without using root access?

Here is my access location: drwxrwsr-x 10 dara nm 4096 Jul 24 11:33 16.20 drwxrwsr-x 8 dara nm 4096 Jul 24 11:22 16.22 Here i want to change the user name instead of dara to lara without using root ...
2
votes
1answer
982 views

Permission denied even though I own it and permissions are 777

I'm on Android using Termux and copied a file from my sdcard to my Termux home folder. (I use a file explorer app with root permissions for that..) Now having the file in my home dir I checked what my ...
1
vote
0answers
317 views

Cannot access mounted volume in docker container

I download latest node images from docker, and try to run a container with the following command: $ sudo docker run -it -v $(pwd)/app:/home/node/app --name node node /bin/bash Then the container was ...
2
votes
2answers
374 views

changing owner UID selectively for 10 users on a 10+TB directory

I have a 10+ TB NFS /home for 100+ users plus public folders. I need to change the username and UID of 10 of those users. At first, I was thinking of running the following: find /home -uid 812 -exec ...
0
votes
3answers
3k views

Give myself permissions for all files in / without bricking my computer? [closed]

How do I give myself read/write/execute permissions for all files in the root directory without making the system unusable? Would this command do it? sudo chown -R jacob3 / sudo chmod -R a+rwx / ...
1
vote
2answers
140 views

Can someone explain what this chown is actually doing?

Can someone in detail explain what exactly the following command that a tutorial has instructed me to issue is doing? chown -R $USER:$GROUP
1
vote
0answers
618 views

npm update check failed on login

I have just logged into my Fedora 25 server to see the following message: npm update check failed Try running with sudo or get access to the local update config store via sudo chown -R $USER:$(id -gn ...