Friday, August 5, 2016

Why Sudo?

Sudo (sometimes considered as short for Super-user do) is a program designed to let system administrators allow some users to execute some commands as root (or another user). The basic philosophy is to give as few privileges as possible but still allow people to get their work done. Sudo is also an effective way to log who ran which command and when.

Why sudo?

Using sudo is better (safer) than opening a session as root for a number of reasons, including:

  • Nobody needs to know the root password (sudo prompts for the current user's password). Extra privileges can be granted to individual users temporarily, and then taken away without the need for a password change.
  • It's easy to run only the commands that require special privileges via sudo; the rest of the time, you work as an unprivileged user, which reduces the damage that mistakes can cause.
  • Auditing/logging: when a sudo command is executed, the original username and the command are logged.

Adding a new user to Debian Linux

Adding user in Debian using terminal

1. open Terminal and log in as root by typing su


2. enter root password and press Enter


3. next, we will add a new user name pedro. Type adduser pedro and press Enter


4. enter the password for user pedro then press Enter. If you like to fill the details the do so, otherwise just leave them blank by pressing the Enter key. Then, press Y to confirm the information is correct.



5. That's it.