

Install sudo, add users to that group, and forget about that root user, unless absolutely necessary. This is the very reason why sudo was created–to prevent administrators from logging in as root and find themselves possibly vulnerable to attacks. The last thing you want is to be logged into your Debian server as the root user. Log in as a user who belongs to the sudo group and you’ll have full admin rights to your server. At this point, you no longer have to log into your Debian minimal server as root to get things done. Once the user logs out and logs back in, they will have full access to sudo.

Where USERNAME is the name of the user to be added. To do this, open your terminal window, su to the root user, and issue the following command: I’ve always found this a much cleaner method on Debian. So instead of messing with the sudoers file, we’re going to add our users to the sudo group. Because this is Debian, everyone that is in the sudo group has full sudo access.

In order for a non-root user to make use of sudo, they either have to be added to the sudoers file using visudo, or added to the sudo group. At the moment the only user that can use sudo is root, and that’s not going to serve our needs. Once the command completes, sudo is installed. Because of this, you might want to run the above commands during non-production periods, reboot the server (if applicable), and then install sudo later.
Install sudo update#
Before we install sudo, let’s update and upgrade the operating system with the following commands:ĭo note, should the kernel get upgraded, a reboot will be necessary, in order for the changes to take effect. To do this, log into your Debian minimal server as root. The first thing that must be done is to install the sudo package.
Install sudo how to#
See: How to install a minimal Debian server Installing sudo But for those who have gone with the minimal Debian install, installing sudo will be necessary. You will note, if you’re working with a standard Debian installation (such as a Desktop install), sudo is probably included, so you won’t have to bother on such an installation. I’m going to walk you through the process of installing sudo on a Debian 8 minimal server. Good news … it’s not only possible, it’s easy. If you fall into that category, you probably would rather have your Debian servers include sudo. When you install Debian, if you need to take care of administrative tasks, you have to su to the root user (like we had to back in the old days), run your commands, and then remember the exit out of the root user.įor many, that’s a security issue waiting to happen. However, did you know an installation of Debian would be missing a crucial package–at least one you’ve probably come to depend upon for admin tasks in Linux. When you go with Debian you know you’re getting an incredibly stable and reliable operating system, one that’s been tried, tested, and proven to be good enough to serve as the basis for so many other Linux distributions. Jack Wallen walks you through the process of installing sudo and enabling it for user.ĭebian is a great platform for your servers. Once you install Debian to function as a server, you might notice it's missing something important-sudo. How to install sudo on a Debian minimal server
