Centos create new user

To create a new user on CentOS, you can use the useradd command. Here are the steps:

  1. Open a terminal as the root user or use sudo to gain root privileges.
  2. Use the following command to create a new user:
    useradd <username>

    Replace <username> with the desired username for the new user.

For example, to create a new user named "john", you would use the following command:

useradd john
  1. The useradd command will create a new user account with a default home directory and shell. You can customize the user's settings by using various options with the useradd command.

Some common options include:

For example, to create a new user named "john" with a home directory and a custom shell, you would use the following command:

useradd -m -s /bin/bash john
  1. To set a password for the new user, use the passwd command:

    passwd john

    Replace john with the username of the new user.

  2. You can also use the usermod command to modify the properties of an existing user account.

For example, to change the shell for an existing user named "john" to /bin/zsh, you would use the following command:

usermod -s /bin/zsh john

Note: The useradd and usermod commands are used to manage user accounts on CentOS. The passwd command is used to set or change passwords for user accounts.