Questions tagged [chown]

All about changing ownership of files.

Filter by
Sorted by
Tagged with
0
votes
1answer
54 views

How create a folder owned by specific username & groupname?

In mac groupadd command does not work: After $ sudo mkdir -p /a/b, a$ ls -l total 0 drwxr-xr-x 2 root wheel 64 12 Jan 09:46 b a$ pwd /a a$ a$ a$ uname -a Darwin user01vl 18.7.0 Darwin Kernel ...
0
votes
1answer
18 views

Change owner to a file when saved in a specific folder

I have a NAS with a directory for each member of my house. My user name, is member of each member's group. So I have access to folders of all users. I want, when I place a file, inside a user's ...
1
vote
1answer
62 views

chgrp chown usermod are useless if not root?

I am logged under 'achille' achille belongs to 2 groups: groups achille achille: achille users I want to change the group owner of file 'tree.test' to group 'users' ls -l tree.test -rw-r--r--. ...
0
votes
2answers
29 views

How do I make a directory part of a group?

I created a directory and the next step is to make that directory part of a group. Is this down with chown? Or another command? This is for my schoolwork. We have gone over permissions and changing ...
0
votes
0answers
43 views

Why I get 2 different outputs for 'whoami' command in Linux?

I got here from StackOverflow because I couldn't find a solution there. Here is the link to the question. When I open terminal and type whoami I get m1ck0 which is my user. But when I enter whoami ...
0
votes
1answer
55 views

useradd account cant login through GUI

I'm using KALI fresh install. Linux kali 5.2.0-kali2-686-pae #1 SMP Debian 5.2.9-2kali1 (2019-08-22) i686 GNU/Linux I created a user using useradd akkilah Then i added this user to sudo group ...
1
vote
1answer
27 views

Why does getegid work for others but not me?

I have the following test program: //File: egid_test.c #include <stdio.h> #include <unistd.h> int main(int argc, char** argv) { int egid = getegid(); printf("my effective group is %...
0
votes
0answers
45 views

Best way to chown on newly created directory via mkdir -p

Suppose I did a mkdir -p a/b/c/d and directories a,b (a/b) already exists. so it will only create c/d. Now I want to only change the owner of directories c and d not a and b using chown. chown -R ...
0
votes
0answers
43 views

Scanned documents only readable by the user that scanned ~linux

I've been troubleshooting some time for this, and I don't seem to be able to work out, what the solution could be. I have a setup, where the copier is connected to my fileserver, so that when a user ...
0
votes
1answer
47 views

Files downloaded from FileZilla have “-????????? ? ? ? ?” permissions and I can't chown them with root

I download some files through FileZilla and all of the files in subdirectories have this "???" owner/group permision: -????????? ? ? ? ? ? file_a.txt -????????? ? ? ? ? ? file_b....
0
votes
1answer
80 views

changing folder ownership, operation permitted, also as root

I have 2 moxa computers (Debian 9) with both an SD card installed. the problem is with one computer's SD card mounting. I can not change group ownerships /dev/mmcblk0p1 /media/sd-mmcblk0p1 vfat rw,...
0
votes
1answer
81 views

I am creating directories using shell script and i am using 'chmod g+s' permission on the directory but the recursive permission is failing [duplicate]

I am creating directories in a shell script with below permissions chmod -R 770 /user/mydir chown -R user:mygroup /user/mydir chown -R g+s /user/mydir However whenever I am creating a new directory ...
0
votes
1answer
27 views

How to operate on a directory with different owner from a script?

Few days ago i have installed elasticsearch, For diagnosing some problems on my elasticsearch setup, i have checked the logs files located in /var/log/elasticsearch and tailed them but apparently the ...
1
vote
1answer
129 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
300 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
78 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 ...
7
votes
2answers
720 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
165 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
199 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 ...
5
votes
2answers
7k 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
104 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
5k 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
293 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
1k 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 ...
1
vote
1answer
4k 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
309 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
238 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
398 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 ...
18
votes
3answers
5k 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
1k 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
305 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 ...
1
vote
1answer
648 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
73 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
50 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
3k 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
572 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
4k 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
72 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
2k 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
588 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
142 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 ...
19
votes
2answers
21k 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
506 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
3k 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
578 views

owner/group getting set to `82`

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 is a tool for running local dev environments, ...
1
vote
0answers
72 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
126 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
12k 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
2answers
702 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
161 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 ...