-2

I tried to set an environment variable for the Sublist3r tool and messed up. Now whenever I switch to the root user (with sudo su) the only command I am able to use is exit (attaching the images).

I tried to edit /root/.bashrc but it seems to be fine on non-root user account. I also checked the PATH on root account which it is showing as 'sublister-1'. How can I edit /root/.bashrc?

2 Answers2

1

As the normal user:

sudo /bin/nano /root/.bashrc

And please don't sudo su, you can use sudo -i and sudo -s to get elevated shells (see the Q/A Is there ever a good reason to run sudo su?).

Kusalananda
  • 333,661
1

sudo su is perfectly okay depending on use cases, as of "missing" commands, utilities is still there, you just need to use full paths to access them.

/usr/bin/nano
/usr/bin/vim

and so on, fix your $PATH and it should be back to normal