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

In Linux file permissions are set in three categories:

permissions

Since the owner, group and others may have different permissions, it is sometimes necessary to change the owner and group to control file access. This is done with the chown command, which can set user and group ownership at the same time:

chown pixie file1          # make pixie owner of file1
chown pixie: file1         # make pixie owner and pixie group of file1
chown :sprites file1       # make sprites group of file1
chown pixie:sprites file1  # make pixie owner and sprites group of file1

chown also has a -R recursive flag, but to make future created files in a directory inherit the same group ownership rather than the creating user's group, the setgid bit should be added to the directory with chmod.

298 questions
39
votes
1 answer

chown recursively changed permissions

I ran the chown command in a directory: chown -R user:user {.,}* The {.,}* is used with mv and cp to include both hidden and listed files. Now this command went through and changed those two files in my directory, but I had to break it to stop since…
nicoX
  • 1,142
  • 3
  • 13
  • 25
26
votes
1 answer

Permissions and ownership of /var/www

I am using Ubuntu 13.04 VPS and have installed LAMP (apache2). Now I have uploaded my web files (WordPress) in /var/www. But I dont have permissions to write in files. When I run WordPress install, it says that it could not write on wp-config php…
5
votes
2 answers

Does chown always require sudo?

Why does an owner of a file in Ubuntu need to run sudo in order to execute chown. Running it without sudo results in an "Operation not permitted" error messge.
5
votes
1 answer

chown: changing ownership of ` ': Operation not permitted

I know this is possible duplicate but I looked at other answers and wasn't satisfied with the responses. You should be able to use the chown command if you are the super user OR the owner of the file. Well, in my case I am the owner of the file, and…
JohnMerlino
  • 7,309
4
votes
2 answers

Having issue with chown

I am trying to run a game on Wine, and for some reason after I run it one time, the files are locked after the first run and I can only open it using a Root account. I want to change ownership so that I can open the file with a regular account. I…
vince
  • 65
4
votes
2 answers

problem during compilation

I am learning how to compile using your CompilingEasyHowTo guide. But as soon as I run the command shown below in the terminal, it shows the following error: tejas@tejas-AU909AA-ACJ-CQ3120IX:~$ sudo chown $tejas /usr/local/src chown: missing operand…
4
votes
1 answer

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?
2
votes
2 answers

chown: cannot access `...' : No such file or directory

I'm trying to change the ownership of a file on Ubuntu 10.04. This is the output from the terminal after typing in the following command: mossen@mossen-desktop:/opt/openfoam211/platforms/linux64GccDPOpt$ ls bin …
Mohsen
  • 21
1
vote
1 answer

chowned /usr to myself, how to recover?

I accidently ran chown myname /usr -R and now the login screen won't show up! I have tried various things in the root terminal, but nothing works. What can I do?
gskartwii
  • 111
  • 1
  • 1
  • 3
1
vote
3 answers

Control file access per user?

Embarrassed to ask this, but have never had to face this before, so... here goes. Some things to know: I have terabytes of storage on a PC that is connected to my television. I have kids who think the word "DELETE" means "FUN!" What I'd like to do…
chow
  • 225
  • 2
  • 8
0
votes
1 answer

How to Remove Recursively grant ownership

I recently switched from Windows 8.1 to Ubuntu. Yesterday, I wanted to install PHP but during tutorial I did this: sudo chown -R joy /var/www but now onward for every command it ask for password $ sudo apt-get install vlc sudo: /var/lib/sudo…
Zarron
  • 1
0
votes
2 answers

Is it bad to chown /media/USERNAME for your web server?

I've been trying to get this software working for my webserver. It's called ownCloud. I had partitioned my hard drive just to host my files on my web server. I made a new partition (128gb) and I've been trying to get it to work with ownCloud. But it…
John
  • 1
0
votes
1 answer

Can't chown mounted HDD under sudo

I recently installed Ubuntu 13.04 in another attempt to drop away from Windows, and am having an issue with my two HDDs. I've gone through the entirety of this tutorial very carefully, but I think either it, or I, am missing…
Phoenixlol
  • 1
  • 1
  • 5
0
votes
3 answers

Correct syntax for using chown on cmd line?

I am trying to change ownership on a file but am having trouble, before it used to work, now I think I am using the wrong syntax, chown -R Person:User ** or is it users? I tried both and none work, what am I doing wrong? Also I am logged as root.
Ferdinand
  • 725
0
votes
0 answers

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/../* which I don't want to happen. How do I…
1
2