zoukankan      html  css  js  c++  java
  • Linux每日一题——(1)创建和删除用户

    useradd命令创建用户
    1.以root身份登录,创建test/test用户
    [root@localhost ~]# useradd test
    [root@localhost ~]# passwd test
    Changing password for user test.
    New UNIX password:
    BAD PASSWORD: it is too short
    Retype new UNIX password:
    passwd: all authentication tokens updated successfully.

    home下查询到test用户主目录
    [root@localhost ~]# cd /home/
    [root@localhost home]# ll
    总计 12
    drwx------ 22 oracle  oinstall 4096 01-06 00:21 oracle
    drwx------  4 test    test     4096 01-09 18:51 test


    userdel删除用户
    1.先删除用户
    [root@localhost /]# userdel test
    [root@localhost /]# cd /home/
    [root@localhost home]# ll
    总计 12
    drwx------ 22 oracle  oinstall 4096 01-06 00:21 oracle
    drwx------  4     502      503 4096 01-09 18:51 test

    2.再删除主目录
    [root@localhost home]# rm -rf test/
    [root@localhost home]# ll
    总计 8
    drwx------ 22 oracle  oinstall 4096 01-06 00:21 oracle

    更好的方法:直接删除用户及主目录
    [root@localhost home]# userdel -r test
    [root@localhost home]# ll
    总计 8
    drwx------ 22 oracle  oinstall 4096 01-06 00:21 oracle

  • 相关阅读:
    poj1631 LIS 裸题
    UESTC 电子科大专题训练 DP-N
    UESTC 电子科大专题训练 DP-M
    UESTC 电子科大专题训练 DP-D
    Codeforces Round #424 D
    Codeforces Round #424 C
    Codeforces Round #424 B
    Codeforces Round #424 A
    hiho一下159
    hiho一下158(hihocoder 1318)
  • 原文地址:https://www.cnblogs.com/downpour/p/2852567.html
Copyright © 2011-2022 走看看