Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added useradd command to _commands/ubuntu/ #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions _commands/ubuntu/useradd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
---

useradd
---
In Linux, a ‘useradd‘ command is a low-level utility that is used for adding/creating user accounts in Linux and other Unix-like operating systems. The ‘adduser‘ is much similar to useradd command, because it is just a symbolic link to it


~~~ bash
$ useradd [options] username
~~~

<!--more-->

### `How it works`
When we run ‘useradd‘ command in Linux terminal, it performs following major things:

1.It edits /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow files for the newly created User account.<br>
2.Creates and populate a home directory for the new user.<br>
3.Sets permissions and ownerships to home directory.<br>

### `Add a new user`
To add/create a new user, all you’ve to follow the command ‘useradd‘ or ‘adduser‘ with ‘username’. The ‘username’ is a user login name, that is used by user to login into the system.

Only one user can be added and that username must be unique (different from other username already exists on the system).

For example, to add a new user called ‘aadhar‘, use the following command.


~~~ bash
$ useradd aadhar
~~~