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.
123
questions
0
votes
0
answers
149
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 ...
0
votes
1
answer
497
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--...
1
vote
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:
...
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 ...
1
vote
1
answer
308
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. ...
0
votes
0
answers
46
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
0
answers
169
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
0
answers
499
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
0
answers
287
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
1
answer
205
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
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/
...
0
votes
1
answer
137
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
1
answer
39
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
0
answers
42
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
1
answer
1k
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 ...
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 ...
2
votes
0
answers
1k
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
0
answers
48
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
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 ...
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 ...
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 ...
0
votes
1
answer
103
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
1
answer
45
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
0
answers
588
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 ...
8
votes
7
answers
25k
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
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?
8
votes
4
answers
31k
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
1
answer
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
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
...
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 ...
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 ...
0
votes
2
answers
263
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.
7
votes
1
answer
45k
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
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 ...
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 ...
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 ...
0
votes
0
answers
779
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
2
answers
7k
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
0
answers
47
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
0
answers
838
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
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 ...
0
votes
1
answer
593
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
1
answer
897
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 ...
4
votes
2
answers
7k
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
0
answers
79
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 ...
1
vote
2
answers
789
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
1
answer
555
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
1
answer
405
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
1
answer
628
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 ...
4
votes
1
answer
6k
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 ...