Linux common commands-43: useradd

The useradd command is used to create a new user or change user information. The created account is saved in the /etc/passwd file.

Syntax format: useradd [parameter] [username]

Common parameters:


 # 创建新的账号xugaoxiang useradd xugaoxiang # 创建账号,但不创建其HOME目录,也就是/home/xugaoxiang,同时禁止登录useradd -M -s /sbin/nologin xugaoxiang添加新用户,指定UID为666,指定用户组为root,toor成员,指定shell类型为/bin/sh # useradd -u 666 -s /bin/sh -G root,toor xugaoxiang

This article is reprinted from
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment

Your email address will not be published.