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 sudo
package is stored.
server1
really RHEL or is it Solaris? – Chris Davies May 20 '20 at 23:20sudo
binary 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 changePATH
for that user. – Hauke Laging May 20 '20 at 23:27sudo -s
(orsudo -i
, I suppose) instead of this horriblesudo su
malarky – 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/sudo
and thensudo -s
that "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~/.bashrc
file. Log out, then log in, then usesudo
. – Kusalananda May 21 '20 at 06:31alias sudo=/tools/xgs/bin/sudo
in 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