The Transformation from Sysadmin to DevOps – Linux Skills

The Transformation from Sysadmin to DevOps – Linux Skills

This is my second blog post in a series of “The Transformation from Sysadmin to DevOps “. If you haven’t read my first blog, you can read The Transformation from Sysadmin to DevOps – Introduction. In this blog post, I will be covering Linux skills required for starting your transformation to DevOps journey.

Linux is one of the top-notch skill sets required even though you are managing infrastructure in the Cloud or On-Premise data centre environment. More than 50% of operating systems in Cloud are running on the top of Linux operating systems. Linux is a natural technology for enabling cloud computing because it’s modular, power-efficient, reliable, open-source, scales to support critical workloads. If you are moving your Linux workload to the Cloud, don’t think that your cloud provider will manage the operating system too. You still need to install operating systems, install application, creating and managing users. So your Linux skillset is still relevant in Cloud also. This blog post will help you get started with Linux, familiarize with Linux commands, file operations, installing software packages, launching a Linux server and connecting to Linux server.

Introduction to Linux

In simple terms, an operating system is a manager. It manages all the available resources on a computer, from the CPU to memory, to hard disk accesses. Linux is one of the operating systems.

image.png

Linux is UNIX clone written from scratch by Linux Torvalds in 1991. Linux has many distributions.

image.png

Some of popular distributions are

  • Redhat

  • Fedora

  • CentOs

  • Ubuntu

  • Debian

  • Suse

Why Linux

  • The main advantage of Linux is it is an open-source operating system. This means the source code is readily available for everyone, and you are allowed to contribute, modify and distribute the code to anyone without any permissions.

  • In terms of security, Linux is more secure than any other operating system. It is less vulnerable than any other operating system. So, it does not require any anti-virus software.

  • The software updates in Linux are easy and frequent. and don’t require a reboot Various Linux distributions are available to use them according to your requirements or according to your taste.

  • It has extensive community support.

  • As with UNIX, a Linux system expects to run without rebooting all the time. That is why many tasks are being executed at night or scheduled automatically for other calm moments, resulting in higher availability during busier periods and more balanced use of the hardware. This property allows for Linux to be applicable in environments where people don’t have the time or the possibility to control their systems night and day.

  • The performance of the Linux system is much higher than other operating systems. It allows a large number of people to work simultaneously, and it handles them efficiently. The flexibility of Linux is high. There is no need to install a complete Linux suit; you can install only the required components.

Linux Boot Process

Before managing any operating systems it is very important to understand the boot process.

Linux Boot Process Explained

image.png

Linux File System

Linux File System or any file system generally is a layer under the operating system that handles the positioning of your data on the storage. The entire Linux directory structure is starting at the top (/) root directory.

image.png

image.png

User Management

We are creating and managing Linux users as one of the significant day-to-day activities for the system administrator. Typical user management includes onboarding, offboarding, managing passwords, disabling accounts, enabling accounts, preserving home directory contents, and fixing permissions. Will give some the user management commands and best practices

  • Creating user account .useradd command for creating a user in Linux operating system. if you want create username with home directoty , you can use useradd -m username
useradd -c "User's Full Name" account_name
$ sudo useradd -c "Mary Jones" mjones$ 
passwd mjones
Changing password for user mjones.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
  • Changing the user password .

    passwd username
    

    is the command to change password for a user

  • Removing User Account .

    userdel -r username
    

    is the command to remove a user from the system

Package Management

Installing, patching, and removing software packages on Linux machines is one of every sysadmin’s everyday tasks. Suppose you are using Redhat, Centos or Amazon Linux. In that case, you can manage packages using “yum”, and if you are using Debian based operating systems like Ubuntu, you can use “apt” to install or manage software. I have added a few links to learn more yum and apt commands.

  • 25 Useful Basic Commands of APT-GET and APT-CACHE for Package Management
  • 20 Practical Examples of RPM Commands in Linux
  • 20 Linux YUM (Yellowdog Updater, Modified) Commands for Package Management

Log Mangement

When you are debugging any issue in your operating systems, log plays a significant role. If you are a good understanding of logs, you can solve most of the problems and error without google. Logs provide good amount of diagnostic information about your operating systems.Log data can be displayed on a terminal, such as a root user’s terminal. Still, more often it is saved in files, or forwarded to a log server.

Linux provides a centralized repository of log files that can be located under the /var/log directory.

  • /var/log/auth.log or /var/log/secure: Keep authentication logs for both successful or failed logins, and authentication processes. Storage depends on system type. For Debian/Ubuntu, look in /var/log/auth.log. For Redhat/CentrOS, go to /var/log/secure.

  • /var/log/boot.log: start-up messages and boot info.

  • /var/log/maillog or var/log/mail.log: is for mail server logs, handy for postfix, smtpd, or email-related services info running on your server.

  • /var/log/kern: keeps in Kernel logs and warning info. Also useful to fix problems with custom kernels.

  • /var/log/dmesg: a repository for device driver messages. Use dmesg to see messages in this file.

  • /var/log/faillog: records info on failed logins. Hence, handy for examining potential security breaches like login credential hacks and brute-force attacks.

  • /var/log/cron: keeps a record of Crond-related messages (cron jobs). Like when the cron daemon started a job.

  • var/log/daemon.log: keeps track of running background services but doesn’t represent them graphically.

  • /var/log/lastlog: holds every user’s last login. A binary file you can read via lastlog command.

  • /var/log/yum.log: holds data on any package installations that used the yum command. So you can check if all went well.

  • /var/log/httpd/: a directory containing error_log and access_log files of the Apache httpd daemon. Every error that httpd comes across is kept in the error_log file. Think of memory problems and other system-related errors. access_log logs all requests which come in via HTTP.

  • /var/log/mysqld.log or /var/log/mysql.log : MySQL log file that records every debug, failure and success message, including starting, stopping and restarting of MySQL daemon mysqld. The system decides on the directory. RedHat, CentOS, Fedora, and other RedHat-based systems use /var/log/mariadb/mariadb.log. However, Debian/Ubuntu use /var/log/mysql/error.log directory.

  • /var/log/spooler: Usually contains nothing, except rare messages from USENET.

If you are working as a support in a production environment, you will probably need to deal with performance-related issues in the Linux environment. Bellow are some of the performance management in tools you can use on Linux.

Top 25 Best Linux Performance Monitoring and Debugging Tools

Linux Operating Systems in Cloud

So far, I have given an overview of Linux Operating systems skills needed when managing in Cloud. Now I will explain some of the essential things facts you need to be aware of.

Following Linux distribution available on most of the cloud vendors

  • Amazon Linux (Amazon Cloud Only)

  • Oracle Linux (Oracle Cloud Only)

  • CentOS

  • Debian

  • Kali

  • Red Hat

  • SUSE

  • Ubuntu

In the next blog, i will cover detailed instructions to launching your first instance

Did you find this article valuable?

Support Nitheesh Poojary by becoming a sponsor. Any amount is appreciated!