How to Change Ownership With The chown Command On Ubuntu 11.10 Oneiric Ocelot

.

Ubuntu Plastic Logo How to Change Ownership With The chown Command On Ubuntu 11.10 Oneiric OcelotYou can use the chmod command to assign permissions in Linux. However, the basis of Linux permissions revolves around the concept of ownership, which you can change using the chown command.

What is file and folder ownership? In Linux file permissions, “ownership” means that the owner, whether the owning user or the owning group, has full control over the file or folder. Basically, every file and folder on a Linux system can be accessed by three different groups of users – the owning user, the owning group, and everybody else with an account on the system. The owning user and group, obviously, are the particular user and group that have been assigned ownership of that file or folder. (The owner and the root user are the only ones who can change or assign permissions to a file.) Everyone else means every other user on the system.

Permissions are then assigned based on those groups – the owning user, the owning group, and all other users on the system.

Assigning permissions is useful, but it’s only the first half of managing security for your files and folders. You may also need to sometimes take ownership of files, or to assign them to different owners. Or you may need to assign a file to a different group.

To change the ownership of files, you can use the chown command. To assign the ownership of the test.txt file to a user named tim:

sudo chown tim test.txt

(You won’t need root permissions to change the ownership of files you already own, but you’ll need it while changing the ownership of files that you don’t own.)

You might have noticed that all this command only affects one file or directory at one time. How do you change the ownership of a large number of files at once? Like the cp or the mv commands, all the commands for managing permissions and ownership work with both the recursive -r option and with wildcards. For instance, to assign ownership of the /test directory, and all its files and sub-directories, to a user named tim:

sudo chown -r tim /test

Using chown, you can quickly manage both ownership on your Linux system.

 How to Change Ownership With The chown Command On Ubuntu 11.10 Oneiric Ocelot

About Frank Boros

Frank Boros has written 107 post in this blog.

Incoming search terms:

Be Sociable, Share!
  • more How to Change Ownership With The chown Command On Ubuntu 11.10 Oneiric Ocelot

    You can leave a response, or trackback from your own site.

    Leave a Reply


    seven × = 56

    Powered by WordPress | Designed by: best suv | Thanks to trucks, infiniti suv and toyota suv
    show
     
    close
    Email
    Print
    WP Socializer Aakash Web
    promotepoint's Profile on Ping.sg