Добавить пользователя в Ubuntu
To add a user in Ubuntu, you can use the `adduser` command. Here is a detailed explanation of how to do it along with some code examples:
1. Open the terminal on your Ubuntu system.
2. Run the following command to add a user:
sudo adduser
Replace `
sudo adduser john
3. The command will prompt you to enter and verify a password for the new user. Follow the instructions to set the password.
4. You can then enter additional information about the user, such as their full name and contact information, or simply press Enter to skip these fields.
5. After creating the user, you might want to add the user to specific groups. For example, if you want the user to have administrative privileges, add them to the `sudo` group.
Run the following command to add a user to a group:
sudo usermod -aG
Replace `
sudo usermod -aG sudo john
6. You can now switch to the newly created user by running the following command:
su -
Replace `
su - john
These code examples demonstrate how to add a user named "john" and add them to the `sudo` group:
bash
sudo adduser john
sudo usermod -aG sudo john
su - john
Once you have followed these steps, the user "john" will be created on your Ubuntu system. You can repeat the process to create additional users as needed.