Skip to main content
link setup to top answer
Source Link
Nagev
  • 489
  • 7
  • 12

In a new Debian server install I too found out that sudo is not installed by default, but it can be done as root:

$ su root
# apt install sudo

What puzzled me is that I still got errors with visudo and usermod:

# visudo
bash: visudo: command not found

# apt install visudo
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package visudo

Actually, visudo is included with the sudo package, it was just not in the PATH for root:

# dpkg -S visudo
sudo: /usr/sbin/visudo
sudo: /usr/share/man/man8/visudo.8.gz

So I added it to the root's ~/.bashrc.

PATH=$PATH:/usr/sbin

Now it can find visudo and usermod which can be used to add setup sudosetup sudo access.

In a new Debian server install I too found out that sudo is not installed by default, but it can be done as root:

$ su root
# apt install sudo

What puzzled me is that I still got errors with visudo and usermod:

# visudo
bash: visudo: command not found

# apt install visudo
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package visudo

Actually, visudo is included with the sudo package, it was just not in the PATH for root:

# dpkg -S visudo
sudo: /usr/sbin/visudo
sudo: /usr/share/man/man8/visudo.8.gz

So I added it to the root's ~/.bashrc.

PATH=$PATH:/usr/sbin

Now it can find visudo and usermod which can be used to add setup sudo access.

In a new Debian server install I too found out that sudo is not installed by default, but it can be done as root:

$ su root
# apt install sudo

What puzzled me is that I still got errors with visudo and usermod:

# visudo
bash: visudo: command not found

# apt install visudo
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package visudo

Actually, visudo is included with the sudo package, it was just not in the PATH for root:

# dpkg -S visudo
sudo: /usr/sbin/visudo
sudo: /usr/share/man/man8/visudo.8.gz

So I added it to the root's ~/.bashrc.

PATH=$PATH:/usr/sbin

Now it can find visudo and usermod which can be used to setup sudo access.

Source Link
Nagev
  • 489
  • 7
  • 12

In a new Debian server install I too found out that sudo is not installed by default, but it can be done as root:

$ su root
# apt install sudo

What puzzled me is that I still got errors with visudo and usermod:

# visudo
bash: visudo: command not found

# apt install visudo
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package visudo

Actually, visudo is included with the sudo package, it was just not in the PATH for root:

# dpkg -S visudo
sudo: /usr/sbin/visudo
sudo: /usr/share/man/man8/visudo.8.gz

So I added it to the root's ~/.bashrc.

PATH=$PATH:/usr/sbin

Now it can find visudo and usermod which can be used to add setup sudo access.