Score:0

i am root but ufw status says 'command not found'

ug flag

as simple user, first I pass root with command :

su

I am now root on Debian 10 buster.

When I hit ufw status, I have 'command not found'. But it works with sudo ufw status

When I use su -, the command is ok.

Can someone explain me this problem / this difference between su and su - and why the command is not found even if I am root in the first case ?

Score:0
in flag

Simple answer is with - you can export path env variables etc. but not with only su, Kindly refer this page.

   -, -l, --login
       Start the shell as a login shell with an environment similar
       to a real login:

       •   clears all the environment variables except TERM and
           variables specified by --whitelist-environment

       •   initializes the environment variables HOME, SHELL, USER,
           LOGNAME, and PATH

       •   changes to the target user’s home directory

       •   sets argv[0] of the shell to '-' in order to make the
           shell a login shell
rach avatar
ug flag
Thank you. This is the exact answer.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.