Is it possible to add a user in ubuntu linux without useradd command I think its possible by adding the entries in /etc/passwd and /etc/shadow
but i don't know the exact steps to do it and the user should get its home directory and bash shell too.
Ubuntu – How to add user without useradd command
passwd-filepasswordusers
Related Question
- Ubuntu – Adding user to chroot environment
- Ubuntu – adduser says user exists when the user does not exist
- Ubuntu – enabling a user (created with adduser command) for lightdm graphical login
- How to Add or Delete User Accounts in Ubuntu GUI
- Add User Bash Script – Proper Way to Add a User Account via Bash Script
Best Answer
It's not recommended to manually modify
/etc/passwd
,/etc/shadow
,/etc/group
or/etc/gshadow
because the risk of breakage. If you're looking for an alternative command that is easier to use, take a look atadduser(8)
. All you have to run is:The shell will be
/bin/bash
by default per/etc/adduser.conf
.Usually, if you wish to add a user with the bash shell, thereby create a home directory
/home/user
and a user group, you would use:This command is basically determining a free User ID
$UID
and Group ID$GID
and then executing the next commands:..and thereby possibly making a backup of the files.
The next manual pages about the file formats may be of interest to you:
passwd(5)
group(5)
shadow(5)
gshadow(5)