---
title: How to create a passwordless sudo user on Ubuntu Linux?
date: '2023-01-12T00:00:00+00:00'
url: https://www.abhinav.co/how-to-create-a-sudo-user-on-ubuntu-linux-without-password
summary: This post talks about the two separate steps that are needed to create sudo
  users without password
tags:
- Ubuntu
- User
author: Abhinav Saxena
---

# How to create a passwordless sudo user on Ubuntu Linux?

On Ubuntu Linux, if you want to create a user with `sudo` powers but without password, you need to follow a couple of steps:

## 1 - Create the user
Assuming you are logged in as root and want to create the user with `deploy` as username. `adduser` command, by default, will ask you to provide a password. To skip, use `--disabled-password` option.

```sh
adduser deploy --disabled-password
adduser deploy sudo
```

`--disabled-password` option will ensure you are not prompted to provide a password during the creation process. The second command, will make the `deploy` user a sudo user.

When you run any `sudo` command, you will still be asked for a password though. To avoid that, you also need to do the second step.

## 2 - Edit sudo file
As the root user, run the following command
```sh
sudo visudo
```

This will open a file (most probably in `nano` editor). Go to the end of the file and add the following line
```
deploy ALL=(ALL) NOPASSWD:ALL
```

If your user is called something else, replace `deploy` with that username. Save the file (for `nano` press Ctrl-X to save the file.)

## And done
Now, whenever you will run any `sudo` command, you won't be prompted for the password.
