Ubuntu系统新增用户

创建用户有两条命令:adduer和useradd,对应着两条删除用户的命令:deluser和userdel。
这两种命令之间的区别:
adduser:会自动为创建的用户指定主目录、系统shell版本,会在创建时输入用户密码。
useradd:需要使用参数选项指定上述基本设置,如果不使用任何参数,则创建的用户无密码、无主目录、没有指定shell版本。
在Ubuntu系统中建议使用adduser命令,比如创建一个openfoam7的用户:

adduser openfoam7

会自动出现:

cfdem@DESKTOP-BVOE5IL:/home$ sudo adduser openfoam7
Adding user `openfoam7' ...
Adding new group `openfoam7' (1002) ...
Adding new user `openfoam7' (1002) with group `openfoam7' ...
Creating home directory `/home/openfoam7' ...
Copying files from `/etc/skel' ...
New password:               #####这个地方输入密封
Retype new password:        #####这个地方重新输入密码
passwd: password updated successfully
Changing the user information for openfoam7
Enter the new value, or press ENTER for the default        #####下面的一路回车
        Full Name []:
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n]

 

posted @ 2023-04-06 16:34  希望先生  阅读(158)  评论(0编辑  收藏  举报