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

  • 相关阅读:
    浏览器extension
    windows 下使用免安装版的mysql
    windows下好用的工具
    那些没来得及做的事
    OSI模型的一张图
    倒计时输出脚本
    selenium忽略链接不安全页面提示的方法
    selenium控制浏览器滚动条缓慢下拉到最底
    paramiko连接主机基本操作
    django点击前端按钮展示后台列表
  • 原文地址:https://www.cnblogs.com/asaka/p/6557710.html
Copyright © 2011-2022 走看看