Questions tagged [chown]

`chown` is an abbreviation of "change owner". This command is used to change the owner and group owner of a file or directory

Filter by
Sorted by
Tagged with
0 votes
0 answers
56 views

Problem with sudo

sudo must be owned by uid 0 and have the setuid bit set So I can't make any changes or install anything. ubuntu 22.04 I am just start study it appreciate your help
2 votes
2 answers
7k views

Ubuntu 14.04 Login Loop from running startx in root

I made a really big mistake and no other articles seem to be fixing this. I was trying to fix my new Ubuntu laptop that I bought because it has the username defualt (spelled wrong) and I didn't like ...
-1 votes
1 answer
286 views

how to fix chown missing operand

in very new to linux and i am trying to install something and this is what I got. sudo chown root:root/usr/bin/bwrap && sudo chmod u+s /usr/bin/bwrap chown: missing operand after ‘root:...
0 votes
0 answers
28 views

change owner of sub-folder in mounted partition

I know there are several similar question. I'm also using linux for quite a while but there is possibly something now that I can't see and I reached a dead end. I have a partition mounted with /etc/...
0 votes
0 answers
48 views

chown: cannot access '/home/myusername/ .cache/mozilla/':No such file or directory

I tried a command (sudo chown $username: -R ~/.cache/mozilla/firfox/) to run firefox because I got error when try to open the Firefox. The error is Your Firefox profile cannot be loaded. It may be ...
131 votes
12 answers
604k views

/usr/bin/sudo must be owned by uid 0 and have the setuid bit set

I have run following command accidentally sudo chown [username] -hR / Now sudo su getting error: sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set How to Solve This?
38 votes
6 answers
123k views

Sudo doesn't work: "/etc/sudoers is owned by uid 1000, should be 0"

When I type a sudo command into the terminal it shows the following error: sudo: /etc/sudoers is owned by uid 1000, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to ...
-4 votes
2 answers
4k views

chown: invalid user: ‘user:group’

sudo chown is resulting in this error. Can someone please help? chown: invalid user: ‘user:group’ Screenshot of Error message
0 votes
0 answers
43 views

ubuntu:ubuntu owns "/" - all server files

So recently, I made a mistake. I did; sudo chown -R ubuntu:ubuntu / Now, my server is pretty non-functioning, and the fact that my server is using 100% of it's space, doesn't make the situation any ...
14 votes
5 answers
84k views

Permission denied on ~ even though owner listed as me

Somehow, I managed to chmod and chown my ~ into oblivion. When I attempt to login through the shell, I get bash: ~/.bashrc : Permission denied Even after (as root) I've run chown -hR nroach44 /...
0 votes
0 answers
71 views

can't take the ownership of my secondary hard drive [duplicate]

i have a ntfs hard mounted on /mnt/HDD and i want to change the ownership of the files inside from root to amiroof. i tried sudo chwon -R amiroof:amiroof /mnt/HDD but that didnt worked and the ...
0 votes
0 answers
500 views

I cannot rm -rf this directory Permission denied even though I have perm WSL2 ubuntu

So there is this location ~/.local/share/nvim/mason/.packages for mason to properly install packages it apparently needs to be able to remove stuff within this folder however my user doesn't have perm ...
4 votes
1 answer
45k views

How to fix "chown: invalid group:" if the user does not exist on the running system?

I want to fix permissions on another disk with chown. Set the permissions to a user which does not exist on the system which is currently running. Does that work without adding the user?
1 vote
0 answers
9k views

sudo chown command fails to give ownership to user account [duplicate]

I have tried running: sudo chown dendy /mnt/storage1/ which returns: chown: changing ownership of '/mnt/storage1/': Operation not permitted I have also tried: sudo chmod 777 /mnt/storage1/ which ...
1 vote
1 answer
204 views

how to us the chown command and mv with find command

I have been searching around and found this question which almost solved my problem. The goal is to have a folder on Ubuntu server which other computers connect to and save files. I have two ...
2 votes
1 answer
6k views

How to run command as another user or keep file attributes?

I run command: find /var/www/html/wp-content/uploads/2015/file.jpg | xargs /usr/local/bin/jpegoptim --max=90 --all-progressive --strip-all --strip-com --strip-exif -- strip-iptc --strip-icc and then ...
1 vote
2 answers
3k views

Give read only access to every user for a folder

I am the owner of directory mydir. I don't have root access. How can I give only read access to someone so that they can create a local copy of mydir? Edit: ChatGPT tells me chmod -R o+r mydir should ...
9 votes
2 answers
15k views

Set myself as owner of /etc with chown command now getting all kinds of errors

I needed to edit a .config file (which I know for a fact is not creating these problems, just to clear that up) and it wouldn't let me save it, so I took ownership of /etc and all contents with the ...
0 votes
1 answer
114 views

How to recover from running "chown -r ubuntu /" [duplicate]

I ran chown -r ubuntu / on my system, and everything is gone. Is there any way to recover? This is a server server hosted on OHV.
1 vote
1 answer
4k views

How to auto mount drive with user permissions

When I mount a drive using fstab, it is owned by root, and I cannot write to it. I have tried chowning the folder where it gets mounted but it does nothing while mounted, and doing it when unmounted ...
0 votes
0 answers
163 views

Give permission to other users to access disk

I created a new disk and mounted it and made entries in fstab file but the disk can only be accessed by the root user.How to 1.Give permission of read and write to the disk for other users 2.Give ...
0 votes
1 answer
194 views

addgroup and chown in Ubuntu

I created a new group with this command: sudo addgroup user123 assign few users to user123 group: sudo usermod -aG user123 sam created a shared directory named user123 but when I try to change ...
-1 votes
2 answers
801 views

Changing ownership of a folder and future subfolders

I am running an ubuntu server. Chown -R plex.plex /Folder just changes the permission of the current folder/subfolders/files. If i create a new folder it doesnt change the ownership to what i want. ...
0 votes
0 answers
80 views

Migrating ownership from macos

I switched from Macos to Ubuntu, now I am trying to own my mac homefolder with Ubuntu. I thought to be smart and use the same username (ruut) and password for the new account and homefolder, but that ...
13 votes
3 answers
15k views

How to create directory and change it's owner with the deb package

I need to create deb package that will create directory for logs. I want to create directory /var/logs/my_package and to change it's owner to my_user. In the docs there is information that I can ...
0 votes
1 answer
599 views

Will usermod update all file and folder permissions correctly?

I have an issue with docker, because docker will write files with UID 1000, but my UID in the host is 1001. a workaround is changing UID of my host user to 1000 that means change the existing user in ...
-1 votes
1 answer
3k views

Unable to change file and folder owner and permission from root to other users ( Ubunto 20.4)

I am new to linux. I have a partition in which all the folder and files owner is set as root.I am unable to change anything using chomd and chown when i write the commands as : sudo chown -c -v user ...
0 votes
0 answers
724 views

How do I use chown -R to include all hidden files and subdirectories except the parent directory (..)?

chown -R owner:group dir/* doesn't change hidden files and directories that begin with '.'. chown -R owner:group dir/.* seems to recursively change hidden files and directories but also changes dir/../...
17 votes
3 answers
160k views

change ownership of all files from root to user

i'm new to Ubuntu and was wondering if there is a way to remove the ownership of all files and scripts from root to user even if i have to re-install Ubuntu? i do know about the command 'chown -v ...
3 votes
0 answers
1k views

root ownership after mounting a drive with ext4 format

I have formatted with ext4 format by GParted: (1) an USB flash drive and (2) an external hard drive. So far so good, but now they have root ownership and non edit permissions. I can update the ...
0 votes
0 answers
70 views

Root account is really not used in Ubuntu? [duplicate]

I'm trying to eliminate some mysterious "Evolution" notifications I keep getting. Google tells me to edit the /etc/xdg/autostart/org.gnome.Evolution-alarm-notify.desktop file, but it is ...
0 votes
1 answer
96 views

I had to reinstall 20.04 and did it badly.. I gave the wrong 'user id' and now cannot access the files... ouch!! how to fix the file / dir mess? [closed]

I have used Ubuntu Linux for at least 10 years, and had a problem. So I re-installed 20.04 and forgot my 'user id' and gave it a new one. Installation went well, but all those disks not involved have ...
6 votes
2 answers
7k views

Can't change the owner back to the root (can't use sudo command) in WSL Ubuntu

I faced this issue when I want to use sudo command : sudo: /etc/sudoers is owned by uid 1000, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin then ...
0 votes
1 answer
2k views

Unable to change permissions and user:group of SMB mounted directory

I have a trueNAS SMB mount to a Proxmox VM directory. The mount works fine however, in order for services to automatically move files from one part of the same directory to another, I need to remove ...
2 votes
3 answers
17k views

What does chown 999 mean?

I know what chmod (change mode) and what chown (change owner) do. I also understand what the numbers mean after chmod do. I was going through a docker tutorial and I saw chown 999 being used. What ...
0 votes
0 answers
78 views

Add Read/Write Permission to Partition

How can you change add Read/Write access to a partition? It was made on Windows, in a exFAT format. When I have it mounted on system startup, I cd into /mnt/myuuid, I got read access, but not write ...
0 votes
1 answer
3k views

chown Operation not permitted

I had original made a Stack Overflow post. I've this command causing errors further down my Jupyter Notebook (detailed in SO post): ! chown -R daemon:daemon elasticsearch-7.9.2 Giving many of these ...
0 votes
0 answers
1k views

chown operation isn't persistent after reboot on 20.04

Recently I have an issue where I have to use a tty to change permissions of my home directory back to my primary user and this happens at every boot. I have no idea what is causing this to not be ...
0 votes
1 answer
909 views

Why I cannot change the owner of files in a mounted directory?

I used the following command to mount a remote directory on an Ubuntu 20.04 machine: sudo mount -t cifs -o username=tidy //192.168.1.11/tidy-mine /media/tidy/f_folder/ When I use the command ls -l,...
1 vote
0 answers
196 views

how to fix this huge mistake I ran sudo chown -R user / [duplicate]

How can I fix this issue? the user is not the root one and unfortunately one of the mounted disks that got affected too was the apps disk of my windows but I am not sure if it got affected as I can ...
34 votes
5 answers
90k views

Is it possible to change ownership of a file without root access?

If a User A owns file.txt, can User A change the ownership of the file to User B without root access? When i run a chown B file.txt as user A, I get a Operation not permitted error. It seems to me ...
3 votes
1 answer
7k views

Why is root user denied access to a file?

I would like to understand in which cases root can be denied access to a file. I am working on a machine I didn't configure (on my personal laptop I obivously don't have this problem) and I am having ...
3 votes
5 answers
57k views

sudo must be owned by uid 0 and have the setuid bit set

I am trying to run the following command: $ echo "My username is: `whoami`" My username is: d $ sudo chown -R `whoami` /usr/local/lib/node_modules sudo: /usr/bin/sudo must be owned by uid 0 and have ...
0 votes
1 answer
2k views

Using chown to change ownership on additional HDD

OS Linux 20.04. Having installed an additional HDD in position /dev/sdc1 (Label Data 22) I am confronted with root as owner. Is either of the following syntaxes correct in order to set me up as owner? ...
1 vote
1 answer
310 views

I ran the following commands by mistake in my Ubuntu 21.04 machine and then everything became broken [duplicate]

Good evening, please I ran the following commands by mistake in my Ubuntu 21.04 machine and then everything became broken... sudo chown john: /* sudo chown john: /** sudo chown john: /**/** and sudo ...
0 votes
2 answers
3k views

Writable permission is not writable

I am running Ubuntu 12.04 x64 server on ext4 partition. I set a directory's permission to '766' as below. sudo chmod 766 /archive drwxrw-rw- 3 root root 4096 Sep 27 10:50 archive/ But, when I ...
3 votes
3 answers
17k views

chmod: Everything on SD Card Stuck On 755, Owner is Root

I am trying to access my SD card as a general user after it somehow changed to just Root access. I have tried several solutions, and none of them worked. Here is an attempt to chown eveything to ...
1 vote
1 answer
2k views

Do I need to use both chown nobody:users and chmod 755

In the command line chown nobody:users /mnt/user/A && chmod 755 /mnt/user/A can I use only chmod 755 /mnt/user/A to give access to anyone or do I need both to make it fully accessible for ...
-1 votes
1 answer
513 views

Have to take ownership of USB port after each reboot

I have a laser engraver. I was having issues getting Ubuntu to talk to it via USB. I finally sorted that out, but now when I reboot, I have to run the command below every time, or I can't talk to the ...
0 votes
1 answer
2k views

`chown postgres` of a subdirectory not working for a new disk

To give postgres more space, I mounted a ssd at: /mnt/fast_data/ What I'd like to accomplish is to give the postgres user ownership to the postgresql directory, so it doesn't say permission denied. $ ...

1
2 3 4 5 6