Configure sudo in Debian
By default, root account is not enabled to log into Debian. As a result, a sudo authentication is needed when you add Debian Linux as a Linux Node.
Follow these steps:
- Log in to the Linux node and switch to root using su command.
- If sudo is not installed, install sudo package using the following command:
- Add an existing user with id=user to group=sudo:
Example:
adduser user sudo
- or create a new user with sudo
- Log into the user shell, and type the following command to verify that the user is authorized:
apt-get install sudo
adduser user
adduser user sudo
sudo -v
You have successfully configured sudo in Debian.
Note: For Debian 12.x, after performing the above steps, open the /etc/sudoers file from root, comment the following line in the sudoers file, and then save the sudoers file:
Defaults use_pty