From ba759652069c33f02f1be8273aca5ce56270227a Mon Sep 17 00:00:00 2001 From: ganome Date: Tue, 12 Nov 2024 10:12:26 -0700 Subject: [PATCH] fixed most of chapter 8 - still needs some polish --- .../Disk Management and Partitions.md | 19 ++-- .../Networking File System.md | 39 -------- .../RAID and LVM.md | 8 -- .../System Log Management (SystemD).md | 99 ++++++------------- .../User and Password Security | 9 -- 5 files changed, 39 insertions(+), 135 deletions(-) delete mode 100644 08 - Advanced Linux Administration/Networking File System.md diff --git a/08 - Advanced Linux Administration/Disk Management and Partitions.md b/08 - Advanced Linux Administration/Disk Management and Partitions.md index 1593518..4a65e6b 100644 --- a/08 - Advanced Linux Administration/Disk Management and Partitions.md +++ b/08 - Advanced Linux Administration/Disk Management and Partitions.md @@ -50,7 +50,7 @@ Linux follows a standardized directory structure: - /etc: System configuration files - /var: Variable data (logs, temporary files) - /boot: Boot loader files -- /mnt and /media: Mount points for removable devices +- /mnt and /run/media: Mount points for removable devices ## 5. Common Disk Management Tools @@ -60,8 +60,8 @@ Linux provides several tools for disk management: - fdisk: Partition table manipulator - parted: Versatile partition tool - lsblk: List block devices -- df: Report file system disk space usage -- du: Estimate file space usage +- df: Report "disk free" in bytes. add "-h" option for human readable +- du: Estimate file space usage for current directory. Add "-h" option for human readable file sizes. ### b. Graphical tools: - GParted: GNOME Partition Editor @@ -72,6 +72,8 @@ Linux provides several tools for disk management: ### a. Viewing disk information: ``` lsblk +``` +``` fdisk -l ``` @@ -79,7 +81,7 @@ fdisk -l ``` sudo fdisk /dev/sdX ``` -(Replace X with the appropriate letter) +(Replace X with the appropriate letter). Follow prompts inside fdisk to create new blank partition. ### c. Formatting a partition: ``` @@ -109,7 +111,7 @@ LVM allows for more flexible disk management, including: - Creating snapshots ### c. RAID (Redundant Array of Independent Disks): -Linux supports software RAID for improved performance and data redundancy. +Linux supports software RAID for improved performance and data redundancy in hardware and software formats. ### d. Encrypting partitions: Use LUKS (Linux Unified Key Setup) for full-disk encryption. @@ -127,10 +129,3 @@ d. Monitor disk health: Use tools like smartctl to check for potential drive fai e. Keep your system updated: Regular updates can improve disk management tools and fix bugs. f. Be cautious with root privileges: Disk management often requires root access, so be careful to avoid accidental data loss. - - -- [(1) How to Install GParted on Linux Mint 21 - Linux Genie.](https://linuxgenie.net/how-to-install-gparted-on-linux-mint-21/.) -- [(2) Linux Mint View & Manage System Partitions: A Comprehensive Guide.](https://bytebitebit.com/tips-tricks/linux-mint-view-manage-system-partitions/.) -- [(3) Linux Mint View Manage System Partitions: A Comprehensive Guide.](https://www.positioniseverything.net/linux-mint-view-manage-system-partitions/.) -- [(4) Mastering Linux Disk Management: LVM and Disk Partitioning.](https://www.linuxjournal.com/content/mastering-linux-disk-management-lvm-and-disk-partitioning.) -- [(5) How to Use Fdisk to Manage Partitions on Linux - How-To Geek.](https://www.howtogeek.com/106873/how-to-use-fdisk-to-manage-partitions-on-linux/.) diff --git a/08 - Advanced Linux Administration/Networking File System.md b/08 - Advanced Linux Administration/Networking File System.md deleted file mode 100644 index 2db328b..0000000 --- a/08 - Advanced Linux Administration/Networking File System.md +++ /dev/null @@ -1,39 +0,0 @@ -## Let's discuss **NTFS (New Technology File System)** and how to work with it in **Linux Mint**. - -1. **Mounting NTFS Partitions**: - - NTFS is the default file system for Windows systems, but we can also mount NTFS partitions in Linux to read and write data. - - To mount an NTFS partition, follow these steps: - - First, create a mount point using the `mkdir` command: - ``` - sudo mkdir /mnt/ntfs - ``` - - Next, use the `mount` command to mount the partition you want (e.g., `/dev/sdb2`): - ``` - sudo mount -t ntfs-3g /dev/sdb2 /mnt/ntfs - ``` - - To check if the partition is mounted, run: - ``` - df -hT - ``` - - Now you have read/write permissions for the NTFS partition you mounted¹². - -2. **Changing File Permissions on NTFS Partitions**: - - To apply Linux-compatible file permissions to an NTFS drive, modify the `/etc/fstab` file. - - Add the following line to `/etc/fstab`: - ``` - /dev/sdb /mnt/ntfs ntfs uid=1000,gid=1000,dmask=022,fmask=133 0 0 - ``` - This line specifies that the `/dev/sdb` partition should be mounted as NTFS in the `/mnt/ntfs` directory. - - Remount the partition or reboot for the changes to take effect². - -Feel free to explore further or ask if you need additional assistance! 😊🚀 - -Source: Conversation with Copilot, 7/12/2024 -- [(1) How to Mount NTFS Partition in Linux - phoenixNAP.](https://phoenixnap.com/kb/mount-ntfs-linux.) -- [(2) Changing File Permissions on NTFS Partitions in Linux.](https://linuxconfig.org/changing-file-permissions-on-ntfs-partitions-in-linux.) -- [(3) How to Mount and Access Windows NTFS Drives in Linux - MUO.](https://www.makeuseof.com/mount-ntfs-windows-drives-in-linux/.) -- [(4) How to Mount an NTFS Partition - Linux Nightly.](https://linuxnightly.com/mount-ntfs-partition/.) -- [(5) Linux mount ntfs or Access NTFS partition from Linux - nixCraft.](https://www.cyberciti.biz/faq/linux-mount-ntfs-or-access-ntfs-partition-from-linux/.) -- [(6) How to mount NTFS partitions using Linux commands.](https://www.computerworld.com/article/1637061/how-to-mount-ntfs-partitions-using-linux-commands.html.) -- [(7) NTFS Disk mounting in mint - Unix & Linux Stack Exchange.](https://unix.stackexchange.com/questions/358229/ntfs-disk-mounting-in-mint.) -- [(8) How to Mount NFS in Linux: A Step-by-Step Guide - Byte Bite Bit.](https://bytebitebit.com/operating-system/linux/how-to-mount-nfs-in-linux/.) \ No newline at end of file diff --git a/08 - Advanced Linux Administration/RAID and LVM.md b/08 - Advanced Linux Administration/RAID and LVM.md index f0d837e..66aa469 100644 --- a/08 - Advanced Linux Administration/RAID and LVM.md +++ b/08 - Advanced Linux Administration/RAID and LVM.md @@ -143,11 +143,3 @@ This setup provides the redundancy of RAID 5 with the flexibility of LVM. - Display PV info: `sudo pvdisplay` - Display VG info: `sudo vgdisplay` - Display LV info: `sudo lvdisplay` - -Remember, LVM provides flexibility, scalability, and ease of maintenance, while RAID enhances performance and data protection! 😊🚀 - -Source: Conversation with Copilot, 7/12/2024 -- [(1) Complete Beginner's Guide to LVM in Linux [With Hands-on].](https://linuxhandbook.com/lvm-guide/.) -- [(2) Linux Storage Management: LVM and RAID.](https://linuxhall.org/linux-storage-management-lvm-and-raid/.) -- [(3) raid - RAIDing with LVM vs MDRAID - Unix & Linux Stack Exchange.](https://unix.stackexchange.com/questions/150644/raiding-with-lvm-vs-mdraid-pros-and-cons.) -- [(4) What is better LVM on RAID or RAID on LVM? - Server Fault.](https://serverfault.com/questions/217666/what-is-better-lvm-on-raid-or-raid-on-lvm.) diff --git a/08 - Advanced Linux Administration/System Log Management (SystemD).md b/08 - Advanced Linux Administration/System Log Management (SystemD).md index 48748ae..26ccb16 100644 --- a/08 - Advanced Linux Administration/System Log Management (SystemD).md +++ b/08 - Advanced Linux Administration/System Log Management (SystemD).md @@ -7,129 +7,94 @@ journalctl is a command-line utility for querying and displaying logs from the s ## 2. Basic Usage ### To view all logs: -``` -journalctl -``` +`journalctl` ### To follow new log entries in real-time: -``` -journalctl -f -``` +`journalctl -f` ## 3. Filtering Logs ### By time: -``` -journalctl --since "2024-01-01 00:00:00" -journalctl --until "2024-01-31 23:59:59" -journalctl --since "1 hour ago" -``` +`journalctl --since "2024-01-01 00:00:00"` + +`journalctl --until "2024-01-31 23:59:59"` + +`journalctl --since "1 hour ago"` + ### By service unit: -``` -journalctl -u nginx.service -journalctl -u ssh.service -``` +`journalctl -u nginx.service` + +`journalctl -u ssh.service` + ### By priority level: -``` -journalctl -p err -``` +`journalctl -p err` Priority levels: emerg, alert, crit, err, warning, notice, info, debug ### By kernel messages: -``` -journalctl -k -``` +`journalctl -k` ## 4. Output Formatting ### JSON output: -``` -journalctl -o json -``` +`journalctl -o json` ### Short output format: -``` -journalctl -o short -``` +`journalctl -o short` ### Verbose output: -``` -journalctl -o verbose -``` +`journalctl -o verbose` ## 5. Boot-specific Logs ### Current boot: -``` -journalctl -b -``` +`journalctl -b` ### Previous boot: -``` -journalctl -b -1 -``` +`journalctl -b -1` ## 6. User-specific Logs -``` -journalctl _UID=1000 -``` +`journalctl _UID=1000` ## 7. Disk Usage and Log Rotation ### View disk usage: -``` -journalctl --disk-usage -``` +`journalctl --disk-usage` ### Rotate logs: -``` -journalctl --rotate -``` +`journalctl --rotate` ### Vacuum old logs: -``` -journalctl --vacuum-time=1week -journalctl --vacuum-size=1G -``` +`journalctl --vacuum-time=1week` + +`journalctl --vacuum-size=1G` + ## 8. Remote Journal Access To access logs on a remote system: -``` -journalctl -D /path/to/journal/directory -``` +`journalctl -D /path/to/journal/directory` ## 9. Persistent Journal Storage ### Edit /etc/systemd/journald.conf: -``` -Storage=persistent -``` +`Storage=persistent` ### Restart journald: -``` -sudo systemctl restart systemd-journald -``` +`sudo systemctl restart systemd-journald` ## 10. Forwarding Logs to a Central Server ### Install rsyslog: -``` -sudo apt install rsyslog -``` +`sudo apt install rsyslog` ### Configure /etc/rsyslog.conf for forwarding: -``` -*.* @@central-log-server:514 -``` +`*.* @@central-log-server:514` ### Restart rsyslog: -``` -sudo systemctl restart rsyslog -``` +`sudo systemctl restart rsyslog` ## 11. Security Considerations diff --git a/08 - Advanced Linux Administration/User and Password Security b/08 - Advanced Linux Administration/User and Password Security index cee0226..9891293 100644 --- a/08 - Advanced Linux Administration/User and Password Security +++ b/08 - Advanced Linux Administration/User and Password Security @@ -36,12 +36,3 @@ - Regularly back up important files to an external location. - Use tools like **rsync**, **Deja Dup**, or cloud storage services¹. -Remember, a combination of these practices helps maintain a secure Linux Mint environment. Feel free to explore further or ask if you need additional guidance! 😊🔒🚀 - -Source: Conversation with Copilot, 7/12/2024 -- [(1) 10 practical tips for securing your Linux Mint system - FOSS Linux.](https://www.fosslinux.com/103872/secure-your-linux-mint-system.htm.) -- [(2) How to reset a forgotten password for any user under Linux Mint 21 ....](https://www.thinkpenguin.com/gnu-linux/how-reset-forgotten-password-any-user-under-linux-mint-21.) -- [(3) Linux Mint 20 [Essential Security Guide: Tools & Tweaks].](https://www.securitybind.com/secure-linux-mint/.) -- [(4) How to Configure Linux Mint Login Window: A Step-by-Step Guide.](https://bytebitebit.com/tips-tricks/how-to-configure-linux-mint-login-window/.) -- [(5) Changes to password policies – The Linux Mint Blog.](https://blog.linuxmint.com/?p=3013.) -- [(6) en.wikipedia.org.](https://en.wikipedia.org/wiki/Linux_Mint.) \ No newline at end of file