problems that novice may encounter when adding users and deleting users in Linux
1. switch to a new user after creating a new User: No directory, logging in with home=/
Add User #sudo useradd-m-s/bin/bash-g Group LoginName -M Create HOME directory (without this to manually add the directory, otherwise there will be no directory,logging in with home=/)-s/bin/bash using Bash (default is/bin/sh Use default does not appear in front of the $ character [email protected])- G Groupthen use passwd to change the user password
2. When deleting a user: Userdel:user HBase is currently logged in
or: Userdel:user test is currently used by process 2417 Userdel:cannot Open/etc/subuid
Many of the solutions available online are as follows:
$mv/var/run/utmp/var/run/utmp_
$touch >/var/run/utmp
about:/var/run/utmp
Utmp is a file, in addition to the UTMP program you can not edit this file, delete his words, the current login information will be lost.
This file will be recreated every time the machine reboot up.
but I have experimented or not, still get the same hint
then brute-Force delete the user:
$ userdel-r-F XXXX
hint: Userdel:warning:can ' t remove/var/mail/git:no such file or directory BR style= "padding:0px; margin:0px; Color:rgb (51,51,51); Font-family: Song body; line-height:25px "> Userdel:git home Directory (/home/git) not found
but it doesn't matter. The user was actually deleted successfully.
As shown in the following:
Problems that novice may encounter when adding users and deleting users in Linux