3

I am unable to run any command on debian, I am getting the above error.
Though when I use sudo same commands works.

Can someone please explain this behavior?

4
  • Why would you ever want to run ufw as a non-root user? Jun 22, 2016 at 11:25
  • @Kusalananda : ufw is just an example, I am getting that error for all commands Jun 22, 2016 at 11:27
  • 1
    @Kusalananda : No you are right, I am getting that error for, those command, who need sudo privilege. Jun 22, 2016 at 11:28
  • @Kusalananda for docker? Sep 12, 2019 at 13:08

1 Answer 1

4

It is likely that the root user on your system is set up with a different default $PATH compared to that of non-root users.

The default paths are specified in /etc/profile, /etc/login.defs, /etc/login.conf or some other file either read by the shell, or by the login command. It differs from system to system.

The ufw command might, for example, live in /usr/sbin/. This directory usually contains tools that only root have any use for (many of them might even require root privileges, such as ufw, which is a firewall configuration tool).

There is no real need to have that directory in the $PATH of ordinary users.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .