Tuesday, March 18, 2025

Linux Administration (Roles & Workflow Commands) | Overview.

Linux Administration (Roles, Workflow Commands) - Overview.

Scope:

  • Intro,
  • System Administration (Role)
  • User & Permission Management,
  • Process & Performance Management,
  • Networking & Security,
  • Backup & Recovery,
  • Automation & Scripting,
  • Workflow Management Commands in Linux,
  • Process Management command & Description,
  • Service & Systemctl Management (command & Description)(command & Description),
  • User & Group Management (command & Description),
  • File Permission & Ownership Management  (command & Description),
  • Disk & Storage Management (command & Description),
  • Network & Firewall Management (command & Description),
  • Log Management & System Monitoring (command & Description),
  • Backup & Recovery (command & Description),
  • Automation & Scheduling Cron Jobs (command & Description),
  • Addendum.


As a Linux Administrator,

    •  twtech primary responsibilities revolve around:
      • System maintenance, 
      • Security, 
      • Performance tuning, 
      • User management, 
      • Automation, 
      • Troubleshooting. 
    • twtech also focuses on key roles and essential workflow management commands used to efficiently manage resources within its Linux environment.
  •  Linux Administrator Roles & Responsibilities

1. System Administration (Role)

    • Install, configure, and manage Linux distributions (RHEL, Ubuntu, CentOS, Debian).
    • Manage system startup, shutdown, and runlevels (SysV init dictates which services are started and stopped, giving twtech administrator absolute control over the system's state).
    • Monitor system logs and audit activities.

2. User & Permission Management

    • Add/remove users and groups.
    • Configure file permissions (chmod, chown, chgrp).
    • Manage SSH access for secure logins.

3. Process & Performance Management

    • Monitor CPU, memory, disk usage.
    • Optimize processes, handle zombie processes, and tune performance.

4. Networking & Security

    • Configure IP, DNS, and firewall rules (iptables, firewalld).
    • Manage SELinux, AppArmor, and fail2ban for security.
    • Set up SSL/TLS certificates for secure communication.

5. Backup & Recovery

    • Automate backups using tar, rsync, cronjobs.
    • Recover lost data and troubleshoot system failures.

6. Automation & Scripting

    • Write Bash scripts for task automation.
    • Manage cron jobs for scheduled tasks.
    • Use Ansible, Puppet, or Chef for configuration management.

 Workflow Management Commands in Linux

NB:

These commands help twtech in process handling, job scheduling, and system management.

1,  Process Management command & Description

Command

Description

ps aux

Show all running processes

top / htop

Real-time process monitoring

kill -9 <PID>

Force kill a process

pkill -f <process-name>

Kill process by name

nohup <command> &

Run a command in background (ignore hangups)

nice -n <priority> <command>

Start process with priority (-20 to 19)

renice <priority> -p <PID>

Change process priority

fg

Bring background job to foreground

bg

Resume background process

jobs

List background jobs

2,   Service & Systemctl Management (command & Description)

Command

Description

systemctl start <service>

Start a service (e.g., Apache, Nginx)

systemctl stop <service>

Stop a service

systemctl restart <service>

Restart a service

systemctl status <service>

Check service status

systemctl enable <service>

Enable service to start on boot

systemctl disable <service>

Disable service from auto-start

 3,  User & Group Management (command & Description)

Command

Description

adduser <username>

Create a new user

passwd <username>

Change user password

usermod -aG <group> <username>

Add user to a group

deluser <username>

Remove a user

groupadd <groupname>

Create a new group

groups <username>

Show groups of a user

4, File Permission & Ownership Management  (command & Description)

Command

Description

ls -l

List files with permissions

chmod 755 <file>

Change file permissions

chown user:group <file>

Change file owner

chgrp <group> <file>

Change file group ownership

5,  Disk & Storage Management (command & Description)

Command

Description

df -h

Show disk space usage

du -sh <directory>

Show directory size

mount /dev/sdX/mnt

Mount a filesystem

umount /mnt

Unmount a filesystem

fdisk -l

List all partitions

mkfs.ext4 /dev/sdX

Format partition with ext4

6, Network & Firewall Management (command & Description),

Command

Description

ip a

Show IP addresses

netstat -tulnp(ortuln)

Show open ports

ss -tulnp

Alternative to netstat

iptables -L

List firewall rules

firewalld --list-all

Show firewall settings

ping <hostname/IP>

Check network connectivity

traceroute <hostname/IP>

Show network path

7,  Log Management & System Monitoring (command & Description),

Command

Description

journalctl -xe

View system logs

tail -f /var/log/syslog

Monitor syslog in real-time

tail -f /var/log/auth.log

Monitor authentication logs

`dmesg

grep -i error`

8,  Backup & Recovery (command & Description),

Command

Description

tar -czvf backup.tar.gz /absolute-path/to/backup

Create a compressed backup

rsync -av /source/destination

Sync files efficiently

scp file user@remote:/absolute-path

Securely copy file to remote system

dd if=/dev/sdX of=backup.img

Create a disk image backup

9,  Automation & Scheduling Cron Jobs (command & Description),

Command

Description

crontab -e

Edit crontab

crontab -l

List scheduled cron jobs

crontab -r

Remove all cron jobs

Sample Cron Job (Runs every day at midnight)

# sh
0 0 * * * /absolute-path-to/script.sh

 Advanced Workflow: Automation & DevOps Integration

NB:

As a Linux Administrator, twtech often integrates commands with DevOps for automation:
    • Uses Ansible commands to configure multiple servers.
    • Writes Bash Shell scripts commands to automate daily tasks.
    • Manages infrastructure by using Terraform command.
    • Deploys applications with Docker & Kubernetes commands
    • Secures infra and application by using, IAM, KMS, Lambda, kebernetes, Trivy, & OWASP commands 
    • Monitors system health with Prometheus + Grafana, Datadog , CloudWatch & ELK commands.

Common Linux Flavors

NB:

    • Linux has many distributions (flavors), each designed for different use cases. 
    • Here are some of the most common Linux Flavors:

General-Purpose Linux Distributions:

    • Ubuntu – User-friendly, great for beginners, and widely used in desktops and servers.
    • Debian – Stable, community-driven, and a base for many other distros (including Ubuntu).
    • Fedora – Cutting-edge software, often used for testing new technologies.
    • openSUSE – Known for YaST, a powerful configuration tool.
    • Arch Linux – Minimalistic, rolling-release distro for advanced users.

Enterprise Linux Distributions:

    • Red Hat Enterprise Linux (RHEL) – Paid support, enterprise-grade security, and stability.
    • CentOS Stream – Upstream of RHEL, community-driven alternative.
    • SUSE Linux Enterprise Server (SLES) – Enterprise-focused, used in mission-critical environments.

Lightweight Linux Distributions:

    • Alpine Linux – Small and security-focused, commonly used in containers.
    • Puppy Linux – Ultra-lightweight, runs on older hardware.
    • Lubuntu/Xubuntu – Ubuntu-based but optimized for low-resource systems.

Security & Penetration Testing Distributions:

    • Kali Linux – Security testing and ethical hacking.
    • Parrot OS – Focused on penetration testing and digital forensics.

Container & Cloud-Focused Distributions:

    • CoreOS (Fedora CoreOS) – Minimal OS designed for container workloads.
    • RancherOS – Lightweight, container-optimized, focused on Docker.
    • Ubuntu Core – Designed for IoT and container-based workloads.

Rolling Release & Source-Based Distributions:

    • Gentoo – Highly customizable, source-based, for advanced users.
    • Slackware – One of the oldest distros, focuses on simplicity and stability.
Addendum : 

Common linux commands




No comments:

Post a Comment

Amazon EventBridge | Overview.

Amazon EventBridge - Overview. Scope: Intro, Core Concepts, Key Benefits, Link to official documentation, What EventBridge  Really  Is (Deep...