Linux: File Ownership

From Define Wiki
Revision as of 19:42, 15 August 2013 by Michael (talk | contribs) (Created page with "== Users and Groups == Linux makes use a users and groups. When looking at /etc/passwd you can see the user and group ids of all users on the system. <syntaxhighlight> redhat:x:30582:...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Users and Groups

Linux makes use a users and groups. When looking at /etc/passwd you can see the user and group ids of all users on the system.

redhat:x:30582:30583::/home/redhat:/bin/bash
manali:x:30583:30584::/home/manali:/bin/bash
armtest:x:30584:30585::/home/armtest:/bin/bash

Each user is assigned a user Id and group id. The default group in Redhat is a group witht eh same name as the user.

File Ownership

Files have a User and Group Owners. The test file is owned by user michael and group tes

-rw-rw-r-- 1 michael root 0 Aug 15 20:41 test


Change the User Owner

chown <newuser> <file>

Change the Group Owner

chgrp <new_group> <file>