Mastering_Linux_Security_and_Hardening_Third Edition by Donald A. Tevault
Author:Donald A. Tevault
Language: eng
Format: epub
Tags: COM046070 - COMPUTERS / Operating Systems / Linux, COM043050 - COMPUTERS / Security / Networking, COM043040 - COMPUTERS / Networking / Network Protocols
Publisher: Packt
Published: 2023-02-22T05:50:47+00:00
Using chown to change ownership of files and directories
Controlling access to files and directories really just boils down to ensuring that the proper users can access their own files and directories, and that each file and directory has permissions set in such a way that only authorized users can access them. The chown utility covers the first part of this equation.
One unique thing about chown is that you must have sudo privileges to use it, even if youâre working with your own files in your own directory. You can use it to change the user of a file or directory, the group thatâs associated with a file or directory, or both at the same time.
First, letâs say that you own the perm_demo.txt file and that you want to change both the user and group association to that of another user. In this case, Iâll change the file ownership from me to maggie:
[donnie@localhost ~]$ ls -l perm_demo.txt -rw-rw-r--. 1 donnie donnie 0 Nov 5 20:02 perm_demo.txt [donnie@localhost ~]$ sudo chown maggie:maggie perm_demo.txt [donnie@localhost ~]$ ls -l perm_demo.txt -rw-rw-r--. 1 maggie maggie 0 Nov 5 20:02 perm_demo.txt [donnie@localhost ~]$
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7745)
Filmora Efficient Editing by Alexander Zacharias(5464)
The Infinite Retina by Robert Scoble Irena Cronin(4910)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3910)
Learn Wireshark - Fundamentals of Wireshark. by Lisa Bock(3802)
Edit Like a Pro with iMovie by Regit(3251)
Linux Administration Best Practices by Scott Alan Miller(2849)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic & Jasmin Redzepagic(2824)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2512)
Docker on Windows by Stoneman Elton(2311)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2300)
Mastering PowerShell Scripting - Fourth Edition by Chris Dent(2226)
Hands-On AWS Penetration Testing with Kali Linux by Karl Gilbert(2099)
Creative Projects for Rust Programmers by Carlo Milanesi(2057)
Hands-On Linux for Architects by Denis Salamanca(2034)
Computers For Seniors For Dummies by Nancy C. Muir(1988)
Programming in C (4th Edition) (Developer's Library) by Stephen G. Kochan(1978)
The Old New Thing by Raymond Chen(1932)
Linux Kernel Debugging by Kaiwan N Billimoria(1757)
