admin管理员组文章数量:1648303
Q. How do I create a new Linux user account ? How do update or modify default Linux new user information? Using the command prompt (shell) tools, how do I add a user to the system? What are command line options for adding a user?
A. To create a new user account under any Linux distribution use command called useradd. The system administrator is responsible for creating account. Login as root user (or use sudo command).
useradd command syntax
[plain] view plain copy print ?
- useradd [options] {username}
useradd [options] {username}
Depending on command line options, the useradd command will update system files (/etc/passwd and /etc/shadow file with password) and may also create the new user's home directory and copy initial files.
Linux add a new user called rakhi
Type the command as follows:
[plain] view plain copy print ?
- useradd rakhi
useradd rakhi
Set a password for rakhi:
[plain] view plain copy print ?
- passwd rakhi
passwd rakhi
Without password user account will be in locked status. To unlock the account, you need to use above passwd command. Use passwd command to assign a password and set password aging guidelines.
Set account disable date
You can set date for the account to be disabled in the format YYYY-MM-DD with -e option while creating account itself:
[plain] view plain copy print ?
- useradd -e {yyyy-mm-dd} {username}
- useradd -e 2008-12-31 jerry
useradd -e {yyyy-mm-dd} {username}
useradd -e 2008-12-31 jerry
Set default password expiry
The -f {days} option set number of days after the password expires until the account is disabled. (If 0 is specified, the account is disabled immediately after the password expires. If -1 is specified, the account is not be disabled after the password expires.)
版权声明:本文标题:Linux Create User Account 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dianzi/1729498182a1203160.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论