How to Configure Passwordless ‘sudo’ on Linux

Set up passwordless sudo for admin users for easier operations on remote servers

Stacked shipping containers under a cloudy sky with the Kubernetes logo on the right.

Many deployment tools (including Mirantis Launchpad) do their work by emulating a user (or root) — logging into remote servers using SSH, and issuing commands.

A secondary requirement (true in Launchpad’s case as well) is ‘passwordless’ access to sudo: the command administrative users are empowered to issue to temporarily assume root-like privileges.

Passwordless sudo access for administrative users is enabled by default for Linux VMs on many cloud platforms. If you’re creating servers or VMs on other platforms (e.g., VirtualBox), you’ll need to enable passwordless sudo as part of initial configuration.

Only one step is required, here. We’re using Ubuntu Server as an example:

Step 1: Enable passwordless sudo for the administrator

First, SSH to your server. In many cases, you’ll have made this ‘passwordless’ as well, so you’ll use your private key:

ssh -i ~/.ssh/id_rsa @

Then start the visudo program (you’ll need to provide your password to make sudo work):

sudo visudo

At the bottom of this file, add the line:

$USER ALL=(ALL) NOPASSWD: ALL

The expression $USER denotes a shell variable automatically set to contain the current user’s username.

Save and exit. Then log out of the machine and back in. You should be able to perform sudo actions without providing your password.

LET'S TALK

Get in touch with Mirantis.

Whether you're planning a new platform, considering a migration, or just exploring options, we'll route your message to the right Mirantis team and get back to you within one business day.


Green circle with tbe number 1 inside.

You submit this form

Green circle with tbe number 2 inside.

Quick call to scope your needs

Green circle with tbe number 3 inside.

Solutions engineer follows up with a tailored plan


We see Mirantis as a strategic partner who can help us provide higher performance and greater success as we expand our cloud computing services internationally.

— Aurelio Forese, Head of Cloud, Netsons

image