Debug School

rakesh kumar
rakesh kumar

Posted on

How to Create a new user account in linux

You can create a new user account in Linux by following these steps:

Open a terminal window.

Switch to the root user account using the su command and entering the root user's password.

su -
Enter fullscreen mode Exit fullscreen mode

Run the adduser command to create a new user. Replace newusername with the desired username for the new account.

adduser newusername
Enter fullscreen mode Exit fullscreen mode
adduser rakesh
Enter fullscreen mode Exit fullscreen mode

Set a password for the new user by running the passwd command and entering a new password when prompted.

passwd newusername
Enter fullscreen mode Exit fullscreen mode

Optionally, you can also add the new user to a specific group using the usermod command. Replace groupname with the desired group name.

usermod -a -G groupname newusername
Enter fullscreen mode Exit fullscreen mode
usermod -a -G developer rakesh
Enter fullscreen mode Exit fullscreen mode

Exit the root user account by running the exit command.

exit
Enter fullscreen mode Exit fullscreen mode

Top comments (0)