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.
128
questions
99
votes
5
answers
418k
views
How to chown/chmod all files in current directory?
I am trying to change the ownership and permissions of some files (and directories) in the current directory. I tried this:
chown username:groupname .
...expecting that it would affect all the files ...
46
votes
2
answers
135k
views
Allow specific user permission to read/write my folder
I have a folder /home/samantha/folder that I want to share with the user tom. He can read/write the folder. How do I do that?
chown wouldn't do it because I still want to be able to be the owner of ...
40
votes
4
answers
84k
views
How to chmod and chown hidden files in Linux?
How do I recursively execute chmod or chown for hidden files?
sudo chmod -R 775 * does not work on hidden files.
The same thing goes for sudo chown -R user:group.
39
votes
3
answers
154k
views
Creating files and directories with a certain owner (user/group) while sudoing
I need to wget something (results in a compressed file in cwd), then I have to extract it, then do some copy/move/modification stuff and perhaps finally execute an script (from the downloaded archive)....
15
votes
4
answers
8k
views
Why unprivileged user can't change file ownership?
From chown(2):
Only a privileged process (Linux: one with the CAP_CHOWN capability) may change the owner of a file. The owner of a file may change the group of the file to any group of which that ...
11
votes
7
answers
29k
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 ...
11
votes
3
answers
28k
views
Transmission-daemon not picking up on watch directory
Trying to get my transmission-daemon to pick up files from a dropbox folder, to make remote starting easier (it's a headless system).
As far as I can tell, the settings.json file is as expected, but ...
10
votes
3
answers
2k
views
How to make a file editable by two different users in different groups?
I have a folder at /home/www/, and the owner is www, which is part of the www-group. I have another user, john, part of the john group. How can I chown /home/www/ to make it writable by both www and ...
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
...
7
votes
1
answer
53k
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?
6
votes
2
answers
52k
views
Can't change owner (user or group) of directory which I have all rights on?
TL;DR: Why am I getting the Operation not permitted? And how can I resolve this?
I'm facing a problem which I can't resolve. I'm creating a directory as user a:group a), which I want to change to ...
6
votes
2
answers
27k
views
Change default permissions for new files and folders
Every time I create a new file or folder in Linux, it is accessible for r/w by myself, not the group. I want to change my system setting such that every new file or folder will be automatically ...
5
votes
6
answers
20k
views
Fixing/Correcting OS X home folder file permissions
Long story short, I managed to muck up the file permissions within my home directory in OS X (Lion). While I'm familiar enough with linux file permissions and more than comfortable changing them, I ...
5
votes
3
answers
22k
views
Multiple Users with owner rights?
I have bought a VPS and I am busy with setting up a FTP server. This is working now, but i can give only one account owner rights. So i have made a group 'administrators' with 2 users. The problem is ...
5
votes
3
answers
19k
views
Git pulling without root access
On a Ubuntu Server 10.10 box, I seem to require root access to use git pull (in my /var/www directory). error: cannot open .git/FETCH_HEAD: Permission denied.
I have tried chmodding 0777 /var/www and ...
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 ...
5
votes
1
answer
1k
views
How to chown large group of files based on previous owner id?
I created a new account in OS X and disposed of my old one.
I have a bunch of files that now have owner 501 that need to have ownership changed to me
[/usr/local]$ ll
total 24
drwxrwxr-x 18 root ...
4
votes
5
answers
72k
views
chown: invalid user: ‘www–data:www-data’
I'm experiencing strage problem.
I simple need to give permissions www-data to a folder
chown -R www–data:www-data /somefolder
chown: invalid user: ‘www–data:www-data’
grep www-data /etc/passwd
www-...
4
votes
3
answers
5k
views
Should /tmp be owned by root?
I'm wondering if /tmp should be owned by root, or rather nobody?
Now with safe mode there are some conflicts, but I am worried about security if I change it to be owned by nobody...
Any advice will ...
4
votes
3
answers
3k
views
Previous version of CGAL with Macports: "Error: Unable to execute port: Could not open file"
I'm trying to install a previous port of cgal with macports. I'm following this How-to:
http://trac.macports.org/wiki/howto/InstallingOlderPort
I already read this answer but it didn't solve for me. (...
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, ...
4
votes
4
answers
4k
views
Is it possible to change the ownership of an executable to root using sudo?
I have an executable created by my userid that I need to have run as root. Therefore I need to change the ownership of my executable to be root:root and use setuid. When I attempt
sudo chown root:...
4
votes
1
answer
7k
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 ...
3
votes
3
answers
9k
views
chown -R root.root /
So I was working and there was a directory that I was periodically changing to my user in a root terminal so that I could open the files in text editors, but I accidentally pressed / instead of . and ...
3
votes
1
answer
4k
views
Accidentally changed the owner of /bin and other directories
I recently made something very, very stupid. Instead of typing: chown adam ./* I wrote: chown adam /* (I forgot about the very important dot). Now I have some files with owner adam instead of... hmm I ...
2
votes
2
answers
1k
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
...
2
votes
3
answers
12k
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 ...
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 ...
2
votes
1
answer
2k
views
Accidentally ran "chown -R ubuntu:ubuntu /", how to repair?
I accidentally ran "chown -R ubuntu:ubuntu /" on a cluster of 10 servers. I've since managed to repair the majority of the filesystem by initially editing /etc/rc.local, placing a lot of chown ...
2
votes
1
answer
235
views
Always create files/folders but only write to those the user owns
I need 2 Linux users to share a folder. Within this folder, users should always be able to create files and sub-folders and write into any sub-folder (whether they own it or not). However, they should ...
2
votes
2
answers
2k
views
Always have to chown when adding new file? Centos 6
Whenever I upload a new file to my server, I have to chown -R apache:apache /dir in order for it to be accessible.
Is there an easier way around this?
2
votes
1
answer
2k
views
Can't change folder permissions on FAT32 partition-Mac OSX
In have an external hard drive which has two partitions:
Mac OSX Extended Journaled
MS-DOS FAT
Basically if I select get info for any file/folder on the FAT partition, there is no option to change ...
2
votes
2
answers
8k
views
chown does not apply owner change
I'm having a problem with Dropbox which seems to be quite common (the problem apperas on all sorts of systems - I'm running on Ubuntu 11.10). From the reading I've done, it seems the problem is that ...
2
votes
1
answer
682
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 ...
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:
...
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
...
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 ...
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 ...
2
votes
1
answer
588
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 ...
2
votes
2
answers
2k
views
Understanding file ownership Linux
I have a Java program on my Linux box and I wanted to create a little one-liner shell script in /bin to prevent having to navigate to the folder of the program and setting all the command line ...
2
votes
2
answers
3k
views
Rsync: after copying as root, change owner to the web user
I seem to come up against this issue occasionally:
serverA assets:
owned by user: apache
(no 'ftp' user present)
serverB assets:
owned by user: ftp
(apache user present, but not used)
I connect ...
2
votes
1
answer
797
views
Unable to create files in a directory
I have created a directory in Virutalbox.
Using VBoxManage, I am executing a script inside the Ubuntu VM directory I created above from Ubuntu host OS. But if the script in the VM contains commands ...
2
votes
0
answers
1k
views
Ubuntu 10.04 with vsftpd: Can't chown /var/www?
For the life of me, I can't seem to chown my /var/www folder on my server. i want to:
chown -R ftpuser /var/www
And it returns Invalid Argument on every file change attempt. I've tried sudo with ...
1
vote
2
answers
437
views
some doubts about chown command in linux?
I am pretty new in Linux and I have a doubt related to the use of the chown command use.
If I have something like this:
chown -R root:root /usr/share/MyApplicationDirectory
What exactly mean?
I ...
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 ...
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
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
3k
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 ...
1
vote
2
answers
340
views
Convert ls -ld to chmod/chown commands
X home dir permissions: drwxr-xr-x
Y home dir permissions: drwxr-x--x
So my question is, how can i convert drwxr-x--x to a chmod/chown command so I can put the same permissions that Y has on his home ...
1
vote
3
answers
1k
views
Major permission repair needed on Mac Os
I made the fatal error of copying and pasting a sudo command into my terminal without double checking it, here it is.
sudo -R mysql /
What this does (for those that don't know) is recursively change ...