How To Add a User and Grant Root Privileges on Ubuntu 18.04

How To Add a User and Grant Root Privileges on Ubuntu 18.04 Техника

How To Add a User and Grant Root Privileges on Ubuntu 18.04

Чтобы запускать административные задачи на Linux, у вас должны быть права суперпользователя (права root). В большинстве дистрибутивов Linux присутствует отдельная учетная запись суперпользователя, но в Ubuntu она по умолчанию отключена. Это позволяет предотвратить случайные ошибки и защитить систему от проникновения. Чтобы запустить команды, которые требуют административный доступ, используйте команду sudo.

Add New Question

See more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Thanks for submitting a tip for review!

Учетная запись суперпользователя в Linux предоставляет полный доступ к системе. Права суперпользователя (администратора) необходимы для выполнения команд в Linux, особенно тех команд, которые затрагивают системные файлы. Так как аккаунт суперпользователя имеет неограниченный доступ к системным файлам, рекомендуется получать права суперпользователя только при необходимости, а не входить в систему в качестве администратора. Это поможет предотвратить случайное повреждение важных системных файлов.

Verify User Has Privileges

# su — microhost

# sudo apt-get update

How To Add a User and Grant Root Privileges on Ubuntu 18.04

After entering the password, this is shown in the below terminal

How To Add a User and Grant Root Privileges on Ubuntu 18.04

How to Grant Admin Permissions in Ubuntu

You’ll need to edit the etc/sudoers file. Although tampering with system files can result in a broken system, a special command called visudo allows you to edit the file with minimal risk.

Add the below line to the file, or uncomment it (by removing the hashmark) if the line’s already present. The line gives root access to the wheel group.

Дополнительно:  Sql injection blind root me solution

%wheel ALL=(ALL) ALL

Adding a Superuser on Ubuntu and Debian

The verification process remains the same as before.

Using the Graphical Interface

Considering CentOS’s popularity, it would be a shame to miss out on the process of adding a sudo account in this distro. The process for adding a sudo account in CentOS is quite similar to the process specified above for Arch Linux, but with a few basic changes.

Об этой статье

Did this summary help you?

Thanks to all authors for creating a page that has been read 1,414,694 times.

Creating a New Superuser on Arch Linux

pacman -Sy sudo

#%wheel ALL=(ALL) ALL

Remove the # symbol preceding the %wheel line and save the changes. Press Ctrl + O on the keyboard to save the file.

I will add a user that is microhost

How To Add a User and Grant Root Privileges on Ubuntu 18.04

## Uncomment to allow members of group wheel to execute any command%wheel ALL=(ALL) ALL

Grant Root Privileges to the User

The above command takes us to the /etc/sudoers.tmp file, where we can see the code below:

How To Add a User and Grant Root Privileges on Ubuntu 18.04

How To Add a User and Grant Root Privileges on Ubuntu 18.04

Press «ctrl» and «x» together. Press «y» and then «enter» at the prompt to save and close the file.

Conclusion

Thank You 🙂

Оцените статью
Master Hi-technology