A
A
Alexey R2021-02-28 19:04:33
linux
Alexey R, 2021-02-28 19:04:33

How to enter superuser mode?

Good afternoon. My Kubuntu system has a user " alex " with superuser rights. And user " dom " with user rights. That is, he is not allowed to execute commands by entering sudo. Because of which I ran into a number of problems. If I need to become a superuser from alex, I type sudo -s, or sudo -i and I'm root, but in order to become root in the terminal from " dom " I need to first become alex and only then root. (su - alex "password" followed by sudo -s "password"). Please tell me if there is a way to immediately become root from under " dom ".
I mean something like (su - alex "password" | sudo -s "password)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
C
CityCat4, 2021-02-28
@Axeles

There are at least two ways.
1. The su
command asks for the root password and requires being in the wheel group (yes, oddly enough, in Linux it's the same as in FreeBSD). If you know - type the password and welcome. This will create a root environment (the home directory is /root, and configuration scripts will run from there)
2. The sudo command asks for the user
's password and requires a properly configured /etc/sudoers. In this case, there will be a user environment. This matters when there are several admins on the machine with different environment settings.

R
Ruslan Fedoseev, 2021-02-28
@martin74ua

the su command changes to root
su
and you are root. This prompts for the root password
. The sudo command allows you to execute other commands as root, while prompting for the user's password.
Those.
su -
enter the root password
and become root from under any user
if there is no root password or it is unknown - configure sudo

A
Adamos, 2021-02-28
@Adamos

If it's required and allowed, just add dom to sudoers.

A
Alexey R, 2021-04-03
@Axeles

I don’t understand this a bit, I want the user to not have root rights. How it is done in the same Debian

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question