The Backbone of IT: Understanding the Role of a System Administrator
Introduction
In the ever-evolving world of technology, System Administrators (SysAdmins) play a vital role in ensuring the smooth operation of an organization's IT infrastructure. They are the unsung heroes who work behind the scenes to keep systems running, networks secure, and users productive. In this article, we'll explore some commands a System Administrator should know.
Some Basic Commands you Should Know as a System Admin
- When you type whoami, you see who you are logged in as
- When you type who, you see who logged in and the time
- When you type echo $SHELL, you see the type of shell you are using
- When you type hostnamectl, you get information of your virtual machine
- When you type useradd charlie, you create a User as a root user
- When you type sudo useradd charlie, you create a User as an ordinary user NOTE:when you create a User with sudo adduser charlie, it will create charlie as the user and ask you to create a password for the user. But when you use sudo useradd charlie, it will only create the username, then you will have to create a password separately.
- When you type sudo passwd charlie, you are creating a password for charlie. Put the password and retype it
- If you want to switch to charlie, firstly, switch to root user sudo su -
- Then type nano /etc/passwd
- Locate charlie, remove sh from bin/sh, and replace it with bash and press cntrl x to save
- Then type su - charlie
- Type sudo userdel charlie to delete the username charlie or any user
- To create a group, type sudo groupadd name of the group (either systemadmin group)
- To check all the groups created, type sudo cat/etc/group
- To add User to the group, type sudo user mod -aG systemadmin charlie. (The aG is used when you want to add User to multiple groups. But G is when you are adding the user to a single group)
- When you type systeminfo, you get information about your system
- When you type cd/var/log/, ll, then cat auth.log, you will see who tried to access your system
- To add User as admin, type cat/etc/sudoers or nano/etc/sudoers or visido
- Scroll down to root user privilege
- Type the username (e.g charlie) ALL =(ALL:ALL) ALL under the roo, then press cntrl x to save
- Type sudo su - charlie to login as charlie
- Type sudo apt update, then put the user password
Top comments (0)