Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (4.85 MB, 13 trang )
<span class="text_page_counter">Trang 1</span><div class="page_container" data-page="1">
: Set-UID, : Set-GID, : stickysu sg t - Some options of the chmod command:
$chmod u+w = add write to *user*
$chmod g-rw = remove read and write from *group*
$chmod o-rwx = remove read, write and execute from *other* $chmod a+w = add write to *all*
$chmod a-wx = remove write and execute from *all* $ chmod 755 myfolder<b>-R</b>
Note: . It allows you to modify objects <b>-Rrecursively</b>, changing permissions on all objects in a directory and its subdirectories
Cấu trúc lệnh tổng quan
<b> $ chmod [options] <permissions> <user1> <file/folder></b>
Các tùy chọn của lệnh chmod: u: Người dùng hiện tại g: Nhóm của người dùng hiện tại
</div><span class="text_page_counter">Trang 3</span><div class="page_container" data-page="3">Các users:
user1 -- Quyen123 user2 -- Quyen456 user3 -- Quyen789 o Create 3 (files or folders)
- Tạo thư mục lab4: $ mkdir Lab4
- Trong thư mục lab4 tạo lần lượt 3 file: file1.txt, file2.txt, file3.txt $ cdLab4
$ touchfile1.txt $ touchfile2.txt $ touchfile3.txt
o Use the chmod command to change the permissions on these files or folders - Hiển thị các quyền mặc định của file1.txt, file2.txt, file3.txt bằng lệnh $ ls -l
</div><span class="text_page_counter">Trang 4</span><div class="page_container" data-page="4">- Thực hiện phân quyền lại cho các file:
$ sudo chmod a+rwx file1.txt thêm quyền đọc, ghi, thực thi cho tất cả user trên file1.txt $ sudo chmod u+rwxfile2.txt thêm quyền đọc, ghi, thực thi cho user hiện tại trên file2.txt $ sudo chmod g+rw file2.txt thêm quyền đọc, ghi cho nhóm user hiện tại trên file2.txt $ sudo chmod o+rfile2.txt thêm quyền đọc cho user khác trên file2.txt
$ sudo chmod u+rw file3.txt thêm quyền đọc, ghi cho user hiện tại trên file3.txt $ sudo chmod g+r file3.txt thêm quyền đọc cho nhóm user hiện tại trên file3.txt $ sudo chmod o-rwx file3.txt xóa quyền đọc, ghi, thực thi cho các user khác trên file3.txt
- Sau khi thiết lập quyền cho hiển thị các quyền trên các file bằng lệnh $ ll -a
</div><span class="text_page_counter">Trang 5</span><div class="page_container" data-page="5">- Create 3 users: Alice, John, Julie
Mở của sổ hộp thoại sau theo đường dẫn: Control Panel\User Accounts\ User Accounts\Manage Accounts để tiến hành thêm account
Tạo account có tên Alice
</div><span class="text_page_counter">Trang 6</span><div class="page_container" data-page="6">-Tạo account có tên John
Tạo account có tên Julie
</div><span class="text_page_counter">Trang 7</span><div class="page_container" data-page="7">- Create folder: huongquyen
- Permissions:
o Alice has full permissions on the folder Data Tạo xong các accounts
</div><span class="text_page_counter">Trang 8</span><div class="page_container" data-page="8">o John has only read permissions on the folder Data
</div><span class="text_page_counter">Trang 9</span><div class="page_container" data-page="9">o Julie has no permissions on the folder Data
- Verify the configuration
Administrator tạo file Configuration trong folder huongquyen để kiểm tra việc phân quyền
</div><span class="text_page_counter">Trang 10</span><div class="page_container" data-page="10">Đăng nhập với account có tên Alice
Alice được phân tồn quyền nên có thể chỉnh sửa file Configuration mà Aministrator đã tạo
Alice tạo file có tên text of Alice trong folder huongquyen mà Aministrator đã tạo
</div><span class="text_page_counter">Trang 11</span><div class="page_container" data-page="11">Đăng nhập với account có tên John
John chỉ được phân quyền đọc nên chỉ có thể đọc file Configuration mà Aministrator đã tạo
</div><span class="text_page_counter">Trang 12</span><div class="page_container" data-page="12">John không thể tạo file hay folder trên folder huongquyen trừ khi có được password của Aministrator
Đăng nhập với account có tên Julie
</div><span class="text_page_counter">Trang 13</span><div class="page_container" data-page="13">Julie khơng được phân bất cứ quyền nào huongquyen nên không thể thực hiện được bất cứ thao tác nào trên folder này
</div>