Add user on Linux Fedora, using useradd command



Configuration for GNU Linux Fedora Computer using Linux Command

    To use Linux or other Unix like machine... you need to login on the machine.  to login on Linux machine you need the username and the password.  This article show the step to create user or add user to Linux machine.  The step below add user on Fedora Linux machine.
Command use to add new user:
# useradd [username] <-- Add user account to Linux system
# passwd [username] <-- Create password for user
# finger [username]  <-- User datails, to verify user created on the system
# adduser [username]  <-- Note: The adduser is useradd command... you can use either one to add user account on the system...

Execute useradd command, and then put your new user username after the useradd command.  The example below show the new user login with username john is add to the system.
User add to Linux system using useradd command
[root@fedora ~]# useradd john
[root@fedora ~]#

To make sure that the new user can login on the machine you need to give password for the user:  The example below show that the password for user john is create.
Create user password on Linux using passwd command
[root@fedora ~]# passwd john
Changing password for user john.
New UNIX password:
BAD PASSWORD: it is too simplistic/systematic
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@fedora ~]#

Make sure that you ask the user to change the default password soonest they login to the system.

Verify user creation:
Verify user exist on Linux system using finger command
[root@fedora ~]# finger john
Login: john                 Name: (null)
Directory: /home/john       Shell: /bin/bash
Never logged in.
No mail.
No Plan.
[root@fedora ~]#

Note:
If you got the messege below... the same username (john) already create before and then have been remove... solution:... create new clean slate user, or you can remove old user home directory and old user mailbox file and re excute command below...
[root@fedora ~]# useradd john
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
Creating mailbox file: File exists
[root@fedora ~]#

The username already on the system... and this is active user.... solution: ...create user with other username....
[root@fedora ~]# adduser john
adduser: user john exists
[root@fedora ~]#




0 comments: