Module Linux essentials - Module 15: Ownership and permissions

Module Linux essentials - Module 15 introduce ownership and permissions in Linux. This module include content: Ownership, identity information, changing file and group ownership, permissions, chmod command, umask command. | Module 15 Ownership and Permissions Exam Objective Managing File Permissions and Ownership Objective Summary File and directory permissions and owners Ownership Viewing Ownership (ls -l) To view the ownerships of a regular file, you can use the ls –l command: [sysadmin@localhost ~]$ ls -l /etc/ -rw-r-----. 1 root named 1163 May 13 10:27 /etc/ To view the ownerships of a directory file, you can use the ls -ld command: [sysadmin@localhost ~]$ ls -ld /etc/named drwxr-x---. 2 root named 4096 Mar 28 2013 /etc/named user owner group owner user owner group owner Viewing Ownership (stat) Another command that allows you to view ownership information in a more detailed way is the stat command: [sysadmin@localhost ~]$ stat /etc/named File: `/etc/named' Size: 4096 Blocks: 8 IO Block: 4096 directory Device: fd00h/64768d Inode: 153995 Links: 2 Access: (0750/drwxr-x---) Uid: ( 0/ root) Gid: ( 25/ named) Access: 2013-10-28 16:21: -0700 Modify: 2013-03-28 15:18: -0700 Change: 2013-05-13 09:56: -0700 user owner group owner File Ownership Every file is owned by a user and a group. If a user creates a file, they will be the user owner of that file. The chown command can change user ownership of a file, but it can only be used by the root user. Although most commands will show the user's account name as the owner, the operating system is actually associating that user’s UID as the file owner. Group Ownership When a file is created, the user's primary group is the group owner of the file. The user can use the chgrp command to change the group owner of a file the user owns, to a group that the user is a member. The root user can use the chgrp command to change the group owner of any file to any group. While most commands will show a group name as the group owner, the system actually tracks group ownership by the GID of the group. Orphaned Files If a user is deleted, or has their UID changed, their former UID will show as the . | Module 15 Ownership and Permissions Exam Objective Managing File Permissions and Ownership Objective Summary File and directory permissions and owners Ownership Viewing Ownership (ls -l) To view the ownerships of a regular file, you can use the ls –l command: [sysadmin@localhost ~]$ ls -l /etc/ -rw-r-----. 1 root named 1163 May 13 10:27 /etc/ To view the ownerships of a directory file, you can use the ls -ld command: [sysadmin@localhost ~]$ ls -ld /etc/named drwxr-x---. 2 root named 4096 Mar 28 2013 /etc/named user owner group owner user owner group owner Viewing Ownership (stat) Another command that allows you to view ownership information in a more detailed way is the stat command: [sysadmin@localhost ~]$ stat /etc/named File: `/etc/named' Size: 4096 Blocks: 8 IO Block: 4096 directory Device: fd00h/64768d Inode: 153995 Links: 2 Access: (0750/drwxr-x---) Uid: ( 0/ root) Gid: ( 25/ named) Access: 2013-10-28 16:21: -0700 Modify: 2013-03-28 .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.