Debian is a Linux distibution which is also known by the name Debian GNU/Linux as most of its OS tools come under the GNU Project for free software. Debian comes bundled with 59000 precompiled software packages all developed and managed by the community-supported Debian Project. This was formed in 1993, August the 16th by Ian Murdock. In comparison to RedHat which is a Linux distribution with inbuilt training and support at a fee, Debian is known as the leader among non commercialised Linux distributions. It is so open that the end user’s voice can be heard in newer versions of the Operating system. This is made possible through peer support and inputs from the Debian community.
Debian is also more keen about stability than Red Hat, comparing Debian 3.0 with Red Hat 7. The version of Debian uses the Linux 2.2 kernel despite the Linux 2.4 kernel being available. Red Hat however bases its version 7 on the Linux 2.4 kernel, which at the time was deemed immature for all platforms.
Sudo which is a short form for Super-user do, is a Linux program that is called up using the
# sudocommand. It allows a user to assume the security privileges of the root user. Here we would create a new user on a Debian OS and grant it access to the sudo program. With this you can avoid logging in as root and still execute admin commands on your Debian system.
To get started, follow these steps:
SSH to your server as root, using your machine's public IP address, supply the password. Accept any prompts the server throws back at you. If it is a first time login, you will have to change the login password for root.
$ ssh root@server_ip_address
To create a new user account called manager, fire the shell command
$ adduser manager
This will bring up a new user password prompt and require confirmation afterwards. Remember to password security. Always use a combination of Uppercase and lower case characters, with a combination of numbers and special characters.
As soon as the new user's password has been set, the program will request additional information, continue by supplying the additional information about the user "manager" as presented below. As the program prompts for more information type the responses and save all by striking the "Y" at the end.
$ Output Adding user `manager' ... Adding new group `manager' (1001) ... Adding new user `manager' (1001) with group `manager' ... Creating home directory `/home/<^>manager' ... Copying files from `/etc/skel' ... Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for sammy Enter the new value, or press ENTER for the default Full Name : Manager of Site Room Number : 456 Work Phone : 789-789-7890 Home Phone : Other : Is the information correct? [Y/n] y
On the Debian OS, users within the sudo group have sudo access granted. To add the user manager to this group, use the usermod command.
$ usermod -aG sudo manager
Now when logged in as the manager, you can execute commands with root privileges by typing:
$ sudo command_name
This will prompt user re-authentication if it is the first time you are using it within a session. You will have to supply the user "manager's" password in order to proceed. Once done the command will be executed with super user access.
To use sudo to list the contents of the root directory, prefix the command with sudo add space and execute as shown below.
$ sudo ls -1 /root
If the site manager gets changed and you need to add a new one, you can delete the first by simply firing the "deluser" command as root:
$ deluser --remove-home manager
Or if logged in as a user with sudo access, you can do the same by executing the following commands:
$ sudo deluser --remove-home manager
We have practiced adding users, adding sudo access to users and deleting users. You can do other things with your debian server such as using the vi editor and configuring secure shell. But with these you can get up and running.