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
0
votes
0answers
9 views

Chown changes reverted to default after reboot

I'm having trouble figuring out why file ownership permissions are being reverted back to default after I reboot. The file is for an nginx web server and for the server to work the ownership must be ...
0
votes
0answers
22 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 ...
0
votes
0answers
42 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?
0
votes
0answers
15 views

Cannot change owner of directory on linux

I have been trying to change the owner of directory mybox2 The directory path is: /home/pi/240G/mybox2 Tried the following commands: pi@raspberrypi:~ $ sudo chown -R pi:pi 240G/mybox2 pi@raspberrypi:~ ...
0
votes
0answers
79 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 ...
0
votes
0answers
31 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 ...
0
votes
1answer
25 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 ...
0
votes
2answers
307 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/ ...
0
votes
1answer
15 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?
0
votes
1answer
30 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. ...
0
votes
0answers
39 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 ...
1
vote
1answer
244 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 ...
4
votes
1answer
806 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 ...
1
vote
0answers
525 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 ...
0
votes
0answers
28 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 ...
2
votes
0answers
703 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 ...
0
votes
1answer
209 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 ...
2
votes
3answers
3k 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 ...
0
votes
1answer
91 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?
0
votes
1answer
42 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 ...
1
vote
0answers
500 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 ...
5
votes
6answers
13k 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 ...
-1
votes
1answer
535 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?
7
votes
3answers
22k 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 ...
0
votes
1answer
2k 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 ...
1
vote
1answer
1k 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 ...
0
votes
2answers
784 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 ...
0
votes
2answers
3k 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 ...
0
votes
2answers
88 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.
3
votes
1answer
23k 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?
0
votes
1answer
3k 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 ...
1
vote
1answer
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 ...
1
vote
1answer
1k 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 ...
0
votes
0answers
645 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 ...
2
votes
2answers
6k 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 ...
1
vote
0answers
36 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". ...
0
votes
0answers
507 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 ...
1
vote
2answers
2k 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 ...
0
votes
1answer
480 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 ...
0
votes
1answer
302 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 ...
2
votes
2answers
4k 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, ...
0
votes
0answers
75 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 ...
0
votes
2answers
594 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 ...
2
votes
1answer
441 views

SSHFS mount marked all files as hidden

I ran chown -R me:me /opt/web/ftp-mounts/ which affected files on sshfs ftp mounts. The remote server hosts IIS based websites. I might have messed up the file permissions on the remote host. Now ...
1
vote
1answer
60 views

Is there any existing tool to recursively substitute the UID/GID by any other?

I used to own the UID #1000 on my personal computers as it is the default in most Linux distributions. On my new computer, I own a completely different UID (which I cannot change). I want to access ...
2
votes
1answer
412 views

How to chown file to containing folders owner

How would you go to chown a file to the containing folder's owner lets say I moved a file from /home/userA/folder/abc.bin towards: /home/userB/finalfolder/abc.bin How can I chown abc.bin to ...
3
votes
1answer
5k views

Why can't I use my newly created user with chown?

So I am attempting to create a new user and group, and then change ownership of a directory to that new user/group. However, when I do, chown comes back with an "illegal user name" message. Here's a ...
0
votes
2answers
880 views

chown -R root:root .* in /root performs chown on /

When running the command in the title from /root it somehow jumps up to / and changes ownership for ALLfiles, i only noticed because error messages for /proc popped up. Maybe i'm getting old but ...
2
votes
3answers
7k views

Why I can't access to this directory after that I use the chown command?

I am not so into Linux and I have the following problem. I have installed a LAMP environment of an Ubuntu Linux system dedicated to the develop (it is on my PC and it is not a production server). So ...
0
votes
2answers
2k views

chown not working on ext4 hard drive

I have a new 3TB internal hard drive and after writing some data to it I completely zero'd the drive using DD. I then created a partition table (GPT) in Gparted and created an ext4 partition. All went ...