zoukankan      html  css  js  c++  java
  • Linux命令第四篇

    作业四:

    1)  新建目录/test/dir,属主为tom,数组为group1,/test目录的权限为777

    # useradd tom

    [root@localhost /]# groupadd group1

    [root@localhost /]# chown tom.group1 /test/dir

    drwxrwxrwx.   3tom grooup1 16 3月  15 18:28 test

    2)  新建用户jack,切换到jack用户下,验证jack用户对dir目录的rwx权限(开启另外一个终端,依次修改dir目录的others权限)

    [root@localhost ~]# su - jack

    cd /test /dir

    [jack@localhost test]$ ll

    总用量 0

    drwxr-xr-x. 2 tom group1 6 3月  15 18:26 dir

    chmod o=r dir

    [root@localhost test]# ll

    总用量 0

    drwxr-xr--. 2 tom group1 6 3月  15 18:26 dir

    3)将jack加入group1组,验证jack用户对dir目录的rwx权限(开启另外一个终端,依次修改dir目录的group权限)

    [root@localhost test]# usermod -G group1 jack

    [root@localhost test]# ll

    总用量 0

    drwxr-xr--. 2 tom group1 6 3月  15 18:26 dir

    4)切换到tom用户,验证tom用户对dir目录的rwx权限(开启另外一个终端,依次修改dir目录的user权限)

    [tom@localhost test]$ ll

    总用量 0

    drwxr-xr--. 2 tom group1 6 3月  15 18:26 dir

    5)在dir目录内新建文件tom.txt,属主为tom,属组为group1,/test目录的权限为777

    [root@localhost dir]# touch tom.txt

    [root@localhost dir]# useradd tom2

    [root@localhost dir]# groupadd group2

    6)新建用户rose,切换到rose用户下,验证rose用户对tom.txt的rwx权限(开启另外一个终端,依次修改tom.txt的others权限来配合验证过程)

    [root@localhost dir]# touch rose.txt

    [root@localhost dir]# useradd rose

    [root@localhost dir]# groupadd rose

    7)将rose加入group1组,在rose用户下,验证rose用户对tom.txt的rwx权限(开启另外一个终端,依次修改tom.txt的group1权限来配合验证过程)

    [root@localhost test]# usermod -G group1 rose

    [root@localhost test]# ll

    总用量 0

    drwxr-xr--. 2 rose group1 6 3月  15 18:26 dir

    8)切换到tom用户,验证tom用户对tom.txt的rwx权限(开启另外一个终端,依次修改tom.txt的user权限来配合验证过程)

    [tom@localhost test]$ ll

    总用量 0

    drwxr-xr--. 2 tom group1 6 3月  15 18:26 dir

  • 相关阅读:
    Lesson 43-44 Vacation Season is Approaching?
    Lesson 41-42 How would you respond?
    Lesson 37-38 Do you want to be a millionaire?
    Lesson 35-36 What did you forget?
    Lesson 33-34 Dieting
    保送
    陈老师搬书
    水题(原 USACO Mother's Milk)
    最大公约数和最小公倍数问题(luogu 1029)
    最大子矩阵(OJ 1768)
  • 原文地址:https://www.cnblogs.com/asaka/p/6557710.html
Copyright © 2011-2022 走看看