How to install sudo on a Debian minimal server – TechRepublic

Register for your free TechRepublic membership or if you are already a member, sign in using your preferred method below.
We recently updated our Terms and Conditions for TechRepublic Premium. By clicking continue, you agree to these updated terms.
Invalid email/username and password combination supplied.
An email has been sent to you with instructions on how to reset your password.
By registering, you agree to the Terms of Use and acknowledge the data practices outlined in the Privacy Policy.
You will also receive a complimentary subscription to TechRepublic’s News and Special Offers newsletter and the Top Story of the Day newsletter. You may unsubscribe from these newsletters at any time.
Username must be unique. Password must be a minimum of 6 characters and have any 3 of the 4 items: a number (0 through 9), a special character (such as !, $, #, %), an uppercase character (A through Z) or a lowercase (a through z) character (no spaces).
How to install sudo on a Debian minimal server
Your email has been sent
Once you install Debian to function as a server, you might notice it’s missing something important–sudo. Jack Wallen walks you through the process of installing sudo and enabling it for user.
Debian is a great platform for your servers. 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.
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. That package is sudo. That’s right. 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.
For many, that’s a security issue waiting to happen. If you fall into that category, you probably would rather have your Debian servers include sudo. Good news … it’s not only possible, it’s easy.
I’m going to walk you through the process of installing sudo on a Debian 8 minimal server. 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. But for those who have gone with the minimal Debian install, installing sudo will be necessary.
See: How to install a minimal Debian server
The first thing that must be done is to install the sudo package. To do this, log into your Debian minimal server as root. Before we install sudo, let’s update and upgrade the operating system with the following commands:
apt update
apt upgrade

Do note, should the kernel get upgraded, a reboot will be necessary, in order for the changes to take effect. 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.
To install sudo, issue the command:
apt install sudo
Once the command completes, sudo is installed. We’re not done. At the moment the only user that can use sudo is root, and that’s not going to serve our needs. Let’s change that.
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. Because this is Debian, everyone that is in the sudo group has full sudo access. So instead of messing with the sudoers file, we’re going to add our users to the sudo group. I’ve always found this a much cleaner method on Debian. To do this, open your terminal window, su to the root user, and issue the following command:
usermod -aG sudo USERNAME
Where USERNAME is the name of the user to be added.
Once the user logs out and logs back in, they will have full access to sudo. At this point, you no longer have to log into your Debian minimal server as root to get things done. Log in as a user who belongs to the sudo group and you’ll have full admin rights to your server.
The last thing you want is to be logged into your Debian server as the root user. Don’t do it. This is the very reason why sudo was created–to prevent administrators from logging in as root and find themselves possibly vulnerable to attacks. Install sudo, add users to that group, and forget about that root user, unless absolutely necessary. This is an important step in securing your Debian server.
How to install sudo on a Debian minimal server
Your email has been sent
Your message has been sent
TechRepublic Premium content helps you solve your toughest IT issues and jump-start your career or next project.
These 11 cloud-to-cloud solutions back up your organization’s data so you’ll be covered in the event of deletions, malware or outages. Compare the best online cloud backup services now.
You can use a mobile device to speak with another person directly through the Teams app. Lance Whitney shows you how to use this handy feature.
A phishing technique called Browser in the Browser (BITB) has emerged, and it’s already aiming at government entities, including Ukraine. Find out how to protect against this new threat.
With so many project management software options to choose from, it can seem daunting to find the right one for your projects or company. We’ve narrowed them down to these nine.
Start-ups, DARPA and Accenture Ventures announce research partnerships, new hardware and strategic investments.
Procuring software packages for an organization is a complicated process that involves more than just technological knowledge. There are financial and support aspects to consider, proof of concepts to evaluate and vendor negotiations to handle. Navigating through the details of an RFP alone can be challenging, so use TechRepublic Premium’s Software Procurement Policy to establish …
Recruiting a Security Analyst with the right combination of technical expertise and experience will require a comprehensive screening process. This hiring kit from TechRepublic Premium includes a job description, sample interview questions and a basic want ad that you can customize for your business to find, interview, recruit and hire the best candidates for a …
Recruiting a DevOps engineer with the right combination of technical expertise and experience will require a comprehensive screening process. This hiring kit from TechRepublic Premium includes a job description, sample interview questions and a basic want ad that you can customize for your business to find, interview, recruit and hire the best candidates for a …
Video game writing jobs are in demand. Recruiting a video game/quest writer with the right combination of technical expertise and experience will require a comprehensive screening process. This hiring kit from TechRepublic Premium includes a job description, sample interview questions and a basic want ad that you can customize for your business to find, interview, …

source

We will be happy to hear your thoughts

Leave a reply

LINXGO
Logo
Compare items
  • Total (0)
Compare