Week 1 of My DevOps Journey: Linux Fundamentals, SSH, and More


📌 The Topics I Learned
This week, I focused on understanding Linux, its fundamental commands, and system management. My learning was guided by the YouTube video: Linux for DevOps Engineers | Beginner to Advanced. Here’s a breakdown of the topics I covered:
How the Internet Works & What are Servers?
Linux OS Overview & Setting Up a Linux Server
Basic Linux Commands for DevOps Engineers
Advanced Linux Commands
Users and Groups Management
File Management in Linux
File Transfer Commands
Linux Networking Commands
Pro Linux Commands (AWK, GREP, FIND, SED)
Linux Volume Management
LVM (Logical Volume Manager) in Linux
🚧 Challenges I Faced
During my learning process, I encountered a few hurdles:
1️⃣ Setting Up SSH (Without AWS EC2 Instance)
Issue: Configuring SSH on my local Linux system instead of an AWS instance was tricky. Initially, I faced errors like "Unit ssh.service could not be found" and "Connection refused" when trying to connect.
Solution:
Commands on the system I wanted to connect to:
whoami
Output:
root
ifconfig
Output: Displays network interfaces and their IP addresses.
hostname -I
Output:
172.30.108.140
(Example IP Address)sudo systemctl status ssh
Output:
Unit ssh.service could not be found.
(SSH not installed)systemctl list-units --type=service | grep ssh
Output: No output (SSH service not found)
dpkg -l | grep openssh
Output:
ii openssh-client 1:8.9p1-3ubuntu0.11 amd64 secure shell (SSH) client, for secure access to remote machines ii openssh-server 1:8.9p1-3ubuntu0.11 amd64 secure shell (SSH) server, for secure access from remote machines ii openssh-sftp-server 1:8.9p1-3ubuntu0.11 amd64 secure shell (SSH) sftp server module, for SFTP access from remote machines
sudo apt update sudo apt install openssh-server -y
Output: Installs OpenSSH server.
sudo systemctl enable --now ssh
Output: SSH service starts successfully.
dpkg -l | grep openssh
Output:
ii openssh-client 1:8.9p1-3ubuntu0.11 amd64 secure shell (SSH) client, for secure access to remote machines ii openssh-server 1:8.9p1-3ubuntu0.11 amd64 secure shell (SSH) server, for secure access from remote machines ii openssh-sftp-server 1:8.9p1-3ubuntu0.11 amd64 secure shell (SSH) sftp server module, for SFTP access from remote machines
ssh root@172.30.108.140
Output: Successfully logs into the remote system.
SSH Key Handling: I didn't need to specify
-i path_to_private_key
because my SSH client automatically used the default private key stored in~/.ssh/id_ed25519
.By default, SSH looks for private keys in:
~/.ssh/id_rsa ~/.ssh/id_ecdsa ~/.ssh/id_ed25519 ~/.ssh/id_dsa (legacy)
Since my system already had a private key (
id_ed25519
), SSH used it automatically when connecting toroot@172.30.108.140
. If I used a different key not stored in the default location, I have to specify it with:ssh -i /path/to/private_key root@172.30.108.140
2️⃣ Linux Volume Management (Without AWS)
Issue: Practicing LVM without cloud resources like AWS was a challenge since many tutorials use EC2 instances.
Solution: I manually created and managed LVM using google Drive:
dd if=/dev/zero of="/mnt/g/disk1.img" bs=1M count=1024 dd if=/dev/zero of="/mnt/g/disk2.img" bs=1M count=2048 dd if=/dev/zero of="/mnt/g/disk3.img" bs=1M count=3072
Output: Creates 1GB, 2GB, and 3GB disk images.
sudo losetup -fP --show /mnt/g/disk1.img sudo losetup -fP --show /mnt/g/disk2.img sudo losetup -fP --show /mnt/g/disk3.img
Output: Attaches the disk images as loop devices.
lsblk
Output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS loop0 7:0 0 2G 0 loop loop1 7:1 0 3G 0 loop loop2 7:2 0 1G 0 loop sda 8:0 0 388.4M 1 disk sdb 8:16 0 2G 0 disk [SWAP] sdc 8:32 0 256G 0 disk /snap /mnt/wslg/distro /
Now I can follow the video.
3️⃣ Understanding Some Linux Commands
Issue: Some commands like
FIND
,UMASK
,KILL
,FUSER
,PS
,VMSTAT
explanations were not clear, requiring further research.Solution: I referred to official documentation and multiple sources to gain clarity and experimented with these commands on my system.
This was my first week of DevOps learning, and I am excited to keep going!
I'm eager to hear about your experiences and insights! Have you embarked on a DevOps journey or faced similar challenges? What strategies or resources have you found helpful? Share your thoughts and tips in the comments below. Let's learn and grow together! 😊
Subscribe to my newsletter
Read articles from Pranab Nandi directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
