# useradd dev1
bash: useradd: command not found
# which useradd
which: no useradd in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
The most common reason for not being able to execute the useradd command on Linux is that you do not have the required packages installed.
Fix: useradd command not found
Install the shadow-utils using the yum package manager,
# yum install shadow-utils
...
Dependencies Resolved
======================================
Package Arch Version Repository Size
======================================
Installing:
shadow-utils aarch64 2:4.1.5.1-24.amzn2.0.2 amzn2-core 1.1 M
Installing for dependencies:
audit-libs aarch64 2.8.1-3.amzn2.1 amzn2-core 99 k
libcap-ng aarch64 0.7.5-4.amzn2.0.4 amzn2-core 25 k
libsemanage aarch64 2.5-11.amzn2 amzn2-core 150 k
ustr aarch64 1.0.4-16.amzn2.0.3 amzn2-core 90 k
Transaction Summary
======================================
Install 1 Package (+4 Dependent packages)
Total download size: 1.4 M
Installed size: 4.8 M
Is this ok [y/d/N]: y
Downloading packages:
(1/5): audit-libs-2.8.1-3.amzn2.1.aarch64.rpm | 99 kB 00:00:00
(2/5): libsemanage-2.5-11.amzn2.aarch64.rpm | 150 kB 00:00:00
(3/5): libcap-ng-0.7.5-4.amzn2.0.4.aarch64.rpm | 25 kB 00:00:01
(4/5): ustr-1.0.4-16.amzn2.0.3.aarch64.rpm | 90 kB 00:00:01
(5/5): shadow-utils-4.1.5.1-24.amzn2.0.2.aarch64.rpm | 1.1 MB 00:00:03
------------------------------------------------------------------------------------------------------------------------------------------
Total 223 kB/s | 1.4 MB 00:00:06
Running transaction check
..
Installed:
shadow-utils.aarch64 2:4.1.5.1-24.amzn2.0.2
Dependency Installed:
audit-libs.aarch64 0:2.8.1-3.amzn2.1 libcap-ng.aarch64 0:0.7.5-4.amzn2.0.4 libsemanage.aarch64 0:2.5-11.amzn2
ustr.aarch64 0:1.0.4-16.amzn2.0.3
Complete!
# useradd dev1
# cat /etc/passwd | grep dev
dev1:x:1000:1000::/home/dev1:/bin/bash

Tested on Amazon Linux Docker Image
Have Questions? Post them here!
- How to Display content of a file in Terminal Screen?
- How to Install CVS Version Control on Linux/Ubuntu
- How to install and Configure sar sysstat tools in Ubuntu Linux
- ls command to list only directories
- [Ubuntu] Search a package and versions using apt command
- zsh hello world example
- Linux Remove or Delete Files and Directories using Terminal Commands
- How to tar.gz a directory or folder Command
- Calculate days between dates using dateutils ddiff command
- How to ls command to output one entry per line [macOS/Linux/Bash]
- 3 Commands to stop Nginx Server
- Create and write file in single Linux/macOS command
- SCP Copy all files from directory to Local Folder
- How to go to the End of File in Nano Editor
- How to remove/delete a directory in Linux/macOs
- How to Copy Entire Directory to another Directory in Linux
- Execute .bin and .run file Ubuntu Linux
- The Date Command and its usage [Linux - Unix - macOS]
- Fix - ssh-copy-id no identities found error
- How to check uptime of Linux/Unix/macOS system/server using console command?
- How to Select All text in vim/vi editor using Keyboard
- Linux: Create a New User and Password and Login Example
- Command to display epoch time Terminal
- How to install curl on Alpine Linux
- How to exit from nano command
- What is Bootstrap Jumbotron and how to use it - Bootstrap
- Test internet speed using macOS Terminal command - MacOS
- Android Eclipse This version of the rendering library is more recent than your version of ADT plug-in. Please update ADT plug-in - Android
- Spring Boot: @RequestBody not applicable to method - Java
- 20 - Python - Print Colors for Text in Terminal - 1000+ Python Programs - Python-Programs
- Set width and height for the label in tkinter - Python
- Install AWS CLI using Brew Command - AWS
- How to fix Java HTTP java.net.UnknownHostException - Java