Artificial intelligent assistant

What the configuration that is needed in order to give root power to another new user in RHEL 7.9 machine we created new user - `moon` **Note** \- user moon created by `useradd` , and we give password by `passwd` command to moon user `moon` user should be with the same strong power privilege as `root` and in order to do it we add the following configuration in `/etc/sudoers` moon ALL=(ALL) ALL moon ALL=(ALL:ALL)ALL moon ALL=(ALL) NOPASSWD:ALL but we have the following problem we access the user moon as # su moon $ whoami moon but when we try change user to `hdfs` user from user `moon` then we get the Password prompt $su hdfs Password: what the configuration that is needed in order bypass the Password , as happened on user `root` here is example from user `root` # su hdfs on above example is from user `root` and we do not need to answer about password

`/etc/sudoers` only configures `sudo`; to exercise the permissions afforded by your configuration, the `moon` user needs to use `sudo`:


sudo -s hdfs


The only user that can `su` to another user without entering a password is `root`, more precisely the user with id 0. The only way to create a `moon` user which operates in the same way as `root` is to give that user id 0 too (several users can have the same id).

To create a user with id 0, create it as usual, _e.g._ using


useradd -N -g 0 moon


then change it to id 0 using


usermod -o -u 0 moon

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy f9a612ac87b47a841bac3dc4aa9716e8