Currently I am running a server on vnc with RHEL 7 operating system.
Background:
- I login to the server say
kpod@server1 - Now when I need to access root permissions. I use the path
/tools/xgs/bin/sudo su - - Instead of the full path, how can I get root access with only running command
sudo?
Note:
/etc/contains -sudoers.rpmsave/etc/doesn't containsudoers.d
How can I become root with running only sudo?
Edit: /tools/xgs/bin/sudo is the path where the sudopackage is stored.
server1really RHEL or is it Solaris? – Chris Davies May 20 '20 at 23:20sudobinary in the existing path? Or is this just about the user you log in as? You could define an alias in the user's shell config or changePATHfor that user. – Hauke Laging May 20 '20 at 23:27sudo -s(orsudo -i, I suppose) instead of this horriblesudo sumalarky – Chris Davies May 20 '20 at 23:31NAME="Red Hat Enterprise Linux Workstation" VERSION="7.4 (Maipo)" ID="rhel" ID_LIKE="fedora" VARIANT="Workstation" VARIANT_ID="workstation" VERSION_ID="7.4" PRETTY_NAME="Red Hat Enterprise Linux Workstation 7.4 (Maipo)"
– Kamalikap May 21 '20 at 01:31sudo : command not found if I try "sudo -s".
– Kamalikap May 21 '20 at 01:36alias sudo=/tools/xgs/bin/sudoand thensudo -sthat "has to work". – Hauke Laging May 21 '20 at 02:03#sudo -s bash: sudo: command not found...
– Kamalikap May 21 '20 at 04:40~/.bashrcfile. Log out, then log in, then usesudo. – Kusalananda May 21 '20 at 06:31alias sudo=/tools/xgs/bin/sudoin the running shell. No need for putting it in a config file in the first step. Usually you want to know whether it works before you put it in a config file. – Hauke Laging May 21 '20 at 19:49