Questions tagged [chown]

The chown command shell of a Unix-like operating system (such as GNU / Linux) is used to change the owner of a particular file.

Filter by
Sorted by
Tagged with
2 votes
2 answers
905 views

root cannot chown /mnt directory

I have a got a USB key with some directories on it. All files belong to root. whoami root id uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 ...
achille's user avatar
  • 137
0 votes
1 answer
36 views

Messed up with /dev/tty* ownership

I was flashing a Flipper Zero Wifi Dev Board and I needed to have /dev/ttyACM0 owned by dialout group... The thing is now I have tried to revert the stuff, making a chown root:tty /dev/tty*, and chmod ...
DaniWein's user avatar
0 votes
0 answers
52 views

Possible in Linux for root to take ownership of a running process without restarting it?

There is a process running under my personal login id that I want to run under root instead. This is only temporary for troubleshooting a problem with it. My login id has sudo privilege but is not ...
bgibson's user avatar
  • 103
0 votes
3 answers
491 views

Why is it possible to assign non-existent users as file owners via the "chown" command?

Why is it possible to assign non-existent users as file owners via the "chown" command? To give you an example sudo chown 03:03 ./test/f2 ls -l -rw-r--r-- 1 3 sys 0 nov 7 17:45 f2 ...
Felix121's user avatar
0 votes
0 answers
216 views

cygwin /usr/bin/install cannot change permissions

When I run /usr/bin/install, I get permissions errors: bifrost ~ 857# groups None Local account and member of Administrators group tsysadm Administrators Users NETWORK Authenticated Users This ...
Erik Bennett's user avatar
0 votes
1 answer
659 views

how to change user and group of a file inside the docker in gitlab-ci

I have a file which when I mount it to the docker, the user and group will change. root@b2d3cb9b2aab:/# ls -lh /etc/logrotate.d/ total 36K -rw-r--r-- 1 root root 120 Sep 11 2021 alternatives -rw-r--...
Amir's user avatar
  • 577
2 votes
0 answers
3k views

Run script with root permission as normal user

Problem: How can I run a script owned by root with root permission as normal user? Let's take for example a folder /path/to/folder. First I make sure that the folder and all content is owned by root: ...
ningelsohn's user avatar
0 votes
1 answer
1k views

Change the ownership of all files & folders based on search result

I know how to find all the files & folders owned by a specific user, say tommy: find / -user tommy But how can I chown the files & folders to another user, say peter? I know I can change ...
Raptor's user avatar
  • 1,090
1 vote
1 answer
406 views

What does it mean to chown a directory non-recursively?

You can do either chown $user $path or chown -R $user $path. What's the difference when $path is a directory? The second invocation would also chown all files and directories inside $path recursively. ...
Noein's user avatar
  • 151
0 votes
0 answers
49 views

Using sgid bit on specific executable files to filter their traffic with iptables

I'm trying to filter traffic with iptables for specific applications by their effective owner id (--gid-owner). For this purpose I've created a group $ sudo addgroup net-user , set this group on an ...
raacer's user avatar
  • 543
0 votes
0 answers
175 views

Mistake - sudo chown -Rh not-root-user /

Well that. Made a terrible mistake on ubuntu server 18.04 (production server) and ran chown -Rh some-not-root-user / Now sudo is not working. Is there any way to reverse this?
Legna's user avatar
  • 101
0 votes
0 answers
545 views

Is it safe to change ownership of several sub directories in /usr/local on MacOS Big Sur?

When trying to install some support for FORTRAN on my macBook running Big Sur and using brew I get an error that some /usr/local folders are not writeable and am asked to use chown to change ownership ...
Nate Lockwood's user avatar
0 votes
0 answers
353 views

How do you set read-only in NFS without root privilege on Linux?

This seems like a relatively straightforward question, but I couldn't really find an answer to this on knowledge bases. Problem I want to protect some files so they cannot be edited, deleted by other ...
boomkin's user avatar
  • 101
0 votes
1 answer
237 views

Recover Ubuntu file owners after improper use of chown

I made the mistake of changing the owner with the command sudo chown -R userG: userG / Now MySQL and other things not working, I try to repair but the ** sudo ** command does not work Give this error ...
sutanejo 's user avatar
0 votes
2 answers
2k views

chmod/chown/mkdir: Operation not permitted as root

I get Operation not permitted for root user on one server but not on the other "identical" server. Running on Amazon Linux 1. Server 1: [root@preprod-1 ]# chown root:root /s3mnt/outliers/ ...
masterpiece's user avatar
0 votes
1 answer
152 views

Using the chown linux command to allow permission on a user and group

The question Recursively set the owner and group of /home/shared/salesproject/ and its contents to sam and sales. I know it would start out 'chown -R' how would the rest go?
jeski2020's user avatar
0 votes
1 answer
40 views

messed up /boot ownership

I messed up /boot directory ownership (CentOS8) and i'm not sure to whom to restore it to. Backstory, the product from work that I am working on has it's own user and group to run its own services. ...
user2187935's user avatar
0 votes
0 answers
43 views

How to (effectively) make a group an owner for changing privileges

I have data on disk which has a high likely-hood of accidentally being modified and I want to remove all write privileges by myself or anyone else. However, occasionally this data DOES need to be ...
nanotek's user avatar
  • 101
1 vote
1 answer
2k views

Can't delete, chown or chmod file even as root

I want to delete a backup of a website (FTP-mirrored with wget), but a single file, named js_composer.less resists. I can create new files and delete them in the same directory, so the problem might ...
Márton Tamás's user avatar
5 votes
1 answer
2k views

Why is a normal user allowed to give away a file/folder by running `podman unshare chown`?

I think that usually a normal user is not allowed to give away a file or directory by running chown without sudo. A question was asked and answered at unix.stackexchange:Why can't a normal user chown ...
Fang Hung-chien's user avatar
2 votes
0 answers
2k views

chown has no effect inside docker container

Core problem I have some files that are currently owned by 'root': root@b75277d71d6f:/app/config/jwt# getfacl public.pem # file: public.pem # owner: root # group: root user::rwx group::r-x ...
admi22's user avatar
  • 21
0 votes
0 answers
57 views

Ubuntu 18.04 SFTP with users and one major user

I have an Ubuntu 18.04 system running and want to access this system using SFTP. I have a lot of users, that shall access /var/ftp/data/%u, additionally, I need a user f_sftp, that can access and read ...
Human_BetaRelease's user avatar
2 votes
0 answers
2k views

FTP User/Group permission on VSFTPD and UBUNTU

I developed a vsftp server with three user groups: g1, g2, g3. Each group has a folder with its name. For example. /home/server/g1 /home/server/g2 /home/server/g3 Each group also has users sudo ...
Mutante's user avatar
  • 121
0 votes
1 answer
1k views

Linux auto chown web uploaded files to users folders

I have a home server that stores my files and I access the files in my internal network with samba. I have 3 users and each user has its home folder on /home/user. In order to access the files from ...
Lorenço Santos's user avatar
2 votes
3 answers
4k views

How to automatically change permissions and owner:group on any file added to a specific directory?

I run an unRAID server (unRAID is based on Slackware) and would like to find a way to automatically change the permissions and ownership of every file added to a specific directory. Specifically, I ...
xthursdayx's user avatar
0 votes
1 answer
108 views

Can I undo a `sudo chown -R /` on Mojave? [duplicate]

I ran a command that ended up executing as sudo chown -R / Can I revert / to default permissions?
MicFin's user avatar
  • 101
0 votes
1 answer
46 views

How do I stop a file changing groups when it is edited

My Debian LAMP web server has files in the website document root with owner:group set at [username]:www-data. When I edit such a file by connecting using sftp and using a text editor the group ...
russell newton's user avatar
1 vote
0 answers
599 views

Mount a windows path (cifs) in a voulme of a docker image

I have a windows file server and an Ubuntu machine which runs docker. Inside this docker there is a Nextcloud container. The /var/www/html inside ther Nextcloud container is mounted as volume on the ...
Max R.'s user avatar
  • 111
10 votes
7 answers
28k views

chown -R exclude some directory

I want to exclude some large content directory I'm Using it to chown Directory chown -R admin /home/admin/web/public_html is there anyway to exclude a subdirectory under html Like: chown -R admin ...
Mitra's user avatar
  • 201
-1 votes
1 answer
1k views

i need help reversing a chmod, chown and 'whoiam' code

I used this code on an app: chmod 600 /Applications/Freedom.app ; chown 'whoami':staff /Applications/Freedom.app Does anyone know how to undo this?
TheBelgianWaffl _ Gaming's user avatar
8 votes
4 answers
32k views

chown: /usr/local: Operation not permitted

How should I fix this? Tue Oct 31 21:52:56 mona@dhcp-wifi-8021x-155-41-82-88:~$ brew update && brew upgrade && brew cleanup Error: /usr/local is not writable. You should change the ...
Mona Jalal's user avatar
0 votes
1 answer
3k views

Can't change owner of folders/files on thumb drive

I have a drive being mounted (either manually or automatically using usbmount) and I can't change the owner or modify the permissions on the mounted drive or folders/files within in order for Mono to ...
Jesse Roper's user avatar
1 vote
1 answer
2k views

How may I mount an external drive in fstab and give owbership to multiple users?

I mount an external drive on my Raspberry-Pi (Debian/stretch) and I mount my external drive in the fstab like this: UUID=1AD09862DC893951 /media/USBHDD1 ntfs-3g nofail,uid=pi,gid=pi,umask=007 0 0 ...
Kangkan's user avatar
  • 248
1 vote
2 answers
1k views

Centos: Apache needs to read files created by Tomcat

After trying a lot of different solutions I came here for some help. I have a web apps in apache HTTPD which serve the frontend and a Java app in Tomcat in the same server. The thing is that the ...
Faabass's user avatar
  • 113
1 vote
2 answers
4k views

Ownership remains unchanged after `sudo chown` in ubuntu

sudo chown reports that it has changed ownership but stat shows that they remain unchanged. I have absolutely no clue as to what might be causing this behavior. Commands and their output are listed ...
Ayushya's user avatar
  • 113
0 votes
2 answers
413 views

How to see when folder access permission is changed?

How to see when folder access permission is changed? The folder now has 777 permission and I want to know when chmod command is run for it. Is it possible? My OS is Ubuntu. Thank you.
hd.'s user avatar
  • 123
7 votes
1 answer
50k views

What is the effect of "chown nobody:nogroup"?

What is the effect of chown nobody:nogroup on a single file or directory and what is the effect on files within a directory?
user727522's user avatar
0 votes
1 answer
4k views

Setting up a local development environment with nginx on Linux (ubuntu)

I recently moved to a new computer, and copied over all existing git repositories for webdevelopment projects from my old computer. On that old computer, I had installed apache to serve certain ...
Qqwy's user avatar
  • 4,447
1 vote
1 answer
2k views

Undo mistaken chown of /usr/bin on macOS Sierra

I made a huge mistake. I wanted to change permissions for /usr/local/bin, but changed permissions for /usr/bin instead. Now I can't use sudo and others. I tried to change it back, but operation is not ...
user avatar
1 vote
1 answer
2k views

linux permissions / chown vs ftp

I have (I guess basic) problems with Linux permissions/ownership. I have FTP user "ftp". Then I have all files on my server under different user "nginx". To make the websites work I need to have all ...
Tim's user avatar
  • 11
0 votes
0 answers
794 views

cannot chown file as root

After mounting a NTFS or fat32 partition (not as readonly), I try to change it to my user permissions with sudo chown user: file However I am then told that the "Operation is not Permitted". I have ...
Lightning77's user avatar
2 votes
2 answers
8k views

How to fix broken "etc/sudoers" ownership on EC2?

Backstory: I was trying to get PHP to execute node, but ended up changing permissions / ownerships on probably more files and folders than I should of. At one point I stumbled upon someone's ...
chamberlainpi's user avatar
1 vote
0 answers
56 views

Logging into new FTP server, but no directories show up

I've tried this with both ProFTPD and SFTP. I'm trying to chroot a user to /var/www/user however when I log in to the FTP server with their account, I get "/var/www/user: No such file or directory". ...
Ryan's user avatar
  • 11
0 votes
0 answers
898 views

Best way to ensure the contents of a directory is always owned by Apache

We have a couple Apache VirtualHosts on a CentOS 7 server, and the PHP sometimes requires the ability to create/edit/delete files and/or folders, so it's important that the permissions always be ...
Justin's user avatar
  • 153
1 vote
2 answers
4k views

How to use wilcards on chown command?

I need to use wildcards on chown command. Example: # chown app:demo /opt/app/users/*/demo I get the following error: chown: can not access "/opt/app/users/*/demo" ': No such file or directory But ...
e-info128's user avatar
  • 162
0 votes
1 answer
666 views

Change owner on its own directory

I have a script running with the user user1:user1, making operations inside a directory dir. At the end of the script, I would like to use chown to change the owner of the script to user2:user2 But ...
ôkio's user avatar
  • 101
0 votes
1 answer
1k views

Script asks for root password even it has executable permissions for everyone

I have a script with name "somescript", which has executable permissions for everyone (755) but when I try to run it with a non-root user it keeps asking root password. I even tried setting to 4755 ...
Gorkem's user avatar
  • 103
4 votes
2 answers
8k views

Unix chown/give permissions to www-data and user

I have a user, 'joe', to whom I would like to grant permissions (for /var/www/html/) so that I can use ftp (with vsftpd) So I run this command: sudo chown -R joe /var/www/html/ And that goes well, ...
joe_young's user avatar
  • 147
0 votes
0 answers
84 views

Unable to change owner on a mapped drive directory

I am using a script to copy files from amazon instances to a network drive using rsync. After the file copy I am trying to change the owner of these transferred files but am not able to. What is the ...
user_mda's user avatar
  • 101
1 vote
2 answers
841 views

Confirmation prompt for chmod, chown

I'm just trying to add a confirmation prompt to a few linux commands like chmod and chown. I've tried to google this but I can't find much information on the topic. While searching I found out ...
Petar Vasilev's user avatar