The following command will create a group called
debian with id
addgroup --gid 1100 debian
The following command will create a user with name
debian, with userid
1100 and will belong to the group
adduser --home /home/debian --shell /bin/bash --uid 1100 --gid 1100 --disabled-password --quiet debian
When the terminal prompts to add user data, just hit Enter key until it finishes.
To delete the user and it's home directory run the following command:
deluser --remove-home -q debian
It might complain that perl is not installed. To install it just run
apt-get install -y perl as root user.
As root user run the following command
echo "myuser ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/myuser
Make sure that files in
/etc/sudoers.d don't have any
~ characters in the name.
Later, if you want to remove the sudo access for the user, just delete it's file from
It is best practice to grant sudo access by creating a file for each user in
/etc/sudoers.dinstead of adding an entry in