From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 2 File Access, Storage, and Security
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Change file and directory ownership
From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 2 File Access, Storage, and Security
Change file and directory ownership
- [Instructor] Before we talk about setting permissions we need to talk about file ownership. A file is owned by exactly one user and one group. If we do an LS-L on a file, we'll see that the long listing includes the files owners. I'm using a fictitious file named file.txt as an example. You can do a long list on any file in your operating system to see similar data. The user owner is the third column from the left. The group owner is the fourth column. The command that we use to change the ownership of a file is chown. The syntax is chown space options, space, username, colon, group name, space, file name. To set the user owner, we just use one name. For instance, chown space user1, space file.txt. Which would change the user owner to user one. Keep in mind that in order to change the ownership of a file you need to be root or elevated privileges with Sudo. To set the group owner, the syntax will be chown space colon group space file.txt. To set both the user and group owners of the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
File and directory modes1m 19s
-
(Locked)
Change file and directory ownership3m 14s
-
(Locked)
Set permissions using numeric mode3m 2s
-
(Locked)
Set permissions using symbolic mode4m 46s
-
(Locked)
Initial permissions using umask4m 30s
-
(Locked)
Special file bits: SUID and SGID4m 59s
-
(Locked)
Special directory bits: SGID and Sticky5m 55s
-
(Locked)
Read access control lists3m 36s
-
(Locked)
Set access control lists (ACLs)5m 49s
-
(Locked)
Configure inheritance with default access control lists4m 27s
-
(Locked)
Delete access control lists4m 15s
-
(Locked)
Challenge: File access control2m 34s
-
(Locked)
Solution: File access control6m 54s
-
-
-
-
-
-