zoukankan      html  css  js  c++  java
  • Linux《用户和用户组》相关命令操作题目

    Linux课有作业:

    进入管理员操作模式
    su
    创建用户
    useradd gzist
    设置口令-》密码
    passwd gzist
    查看账号信息
    cat /etc/passwd

    (1)

    创建stus组
    groupadd stus
    创建用户
    useradd thxy
    添加thxy到用户组stus
    usermod -aG stus thxy
    指定目录
    usermod -d /home/thxydir -u 1002 thxy 1002代表uid 上面cat...看用户信息
    设置thxy口令
    passwd thxy
    (2)
    修改用户
    usermod -l ty thxy
    (3)
    修改目录
    usermod -d /home/xy -u 1002 ty
    (4)
    创建账户
    useradd gl
    设置口令
    passwd gl
    添加到组
    usermod -aG stus gl
    (5)
    查询gl口令状态
    锁定
    passwd -l gl
    查看锁定状态
    passwd -S gl (看到locking....))表示锁定成功
    (6)
    vi /etc/login.defs
    按字母 i 进入输入模式 手动修改题目说的

    修改完后

    按esc进入命令模式

    按大写ZZ退出编辑
    (7)
    查看chage命令
    chage -help
    chage -m 30 -W 7 ty
    查看是否修改成功
    chage -l ty
    (8)
    usermod -u 600 gl
    继续cat /etc/passwd 查看是否修改成功
    (9)
    解锁
    passwd -u gl
    查看锁定状态
    passwd -S gl (看到unlocking....))表示解锁成功

    图片复制进来有点模糊 大家看附件

    https://files.cnblogs.com/files/NanKe-Studying/20210922linux%E4%BD%9C%E4%B8%9A.zip

     

  • 相关阅读:
    HDU-2502-月之数
    C语言的位运算的优势
    HDU-1026-Ignatius and the Princess I
    HDU-1015-Safecracker
    HDU-1398-Square Coins
    HDU-1028-Ignatius and the Princess III
    背包的硬币问题
    HDU-1527-取石子游戏
    HDU-1996-汉诺塔VI
    css中的选择器
  • 原文地址:https://www.cnblogs.com/NanKe-Studying/p/15319574.html
Copyright © 2011-2022 走看看