Merge pull request #31 from SCAR-iT-COLO/20-sanitize-chapter-8
20 sanitize chapter 8
This commit is contained in:
commit
57d07f1f13
@ -1,27 +0,0 @@
|
|||||||
## In **Linux Mint**, package management is essential for installing, updating, and managing software. Let's explore some key tools and concepts:
|
|
||||||
|
|
||||||
1. **APT (Advanced Packaging Tool)**:
|
|
||||||
- APT is the primary package manager for Debian-based systems, including Linux Mint.
|
|
||||||
- It handles software installation, removal, querying, and upgrades.
|
|
||||||
- Common APT commands:
|
|
||||||
- `sudo apt update`: Refreshes package lists from repositories.
|
|
||||||
- `sudo apt install package-name`: Installs a package.
|
|
||||||
- `sudo apt remove package-name`: Removes a package.
|
|
||||||
- `sudo apt upgrade`: Upgrades installed packages.
|
|
||||||
- `sudo apt search keyword`: Searches for packages.
|
|
||||||
- APT uses `.deb` packages and works alongside `dpkg`, which installs individual `.deb` files.
|
|
||||||
|
|
||||||
2. **Synaptic Package Manager**:
|
|
||||||
- Synaptic is an advanced graphical package management tool.
|
|
||||||
- To install Synaptic:
|
|
||||||
```
|
|
||||||
sudo apt install synaptic
|
|
||||||
```
|
|
||||||
- Launch it from the Applications menu or by typing `synaptic` in the terminal.
|
|
||||||
|
|
||||||
Remember, APT and Synaptic empower you to manage software efficiently in Linux Mint! 😊🚀 ²³
|
|
||||||
|
|
||||||
Source: Conversation with Copilot, 7/12/2024
|
|
||||||
- [(1) How to Install and Update Apps on Linux Mint - UMA Technology.](https://umatechnology.org/how-to-install-and-update-apps-on-linux-mint/.)
|
|
||||||
- [(2) How to Use APT Command in Linux [15 Useful Examples] - UbuntuMint.](https://www.ubuntumint.com/apt-commands/.)
|
|
||||||
- [(3) Package Management Essentials: apt, yum, dnf, pkg.](https://www.digitalocean.com/community/tutorials/package-management-basics-apt-yum-dnf-pkg.)
|
|
||||||
@ -50,7 +50,7 @@ Linux follows a standardized directory structure:
|
|||||||
- /etc: System configuration files
|
- /etc: System configuration files
|
||||||
- /var: Variable data (logs, temporary files)
|
- /var: Variable data (logs, temporary files)
|
||||||
- /boot: Boot loader 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
|
## 5. Common Disk Management Tools
|
||||||
|
|
||||||
@ -60,8 +60,8 @@ Linux provides several tools for disk management:
|
|||||||
- fdisk: Partition table manipulator
|
- fdisk: Partition table manipulator
|
||||||
- parted: Versatile partition tool
|
- parted: Versatile partition tool
|
||||||
- lsblk: List block devices
|
- lsblk: List block devices
|
||||||
- df: Report file system disk space usage
|
- df: Report "disk free" in bytes. add "-h" option for human readable
|
||||||
- du: Estimate file space usage
|
- du: Estimate file space usage for current directory. Add "-h" option for human readable file sizes.
|
||||||
|
|
||||||
### b. Graphical tools:
|
### b. Graphical tools:
|
||||||
- GParted: GNOME Partition Editor
|
- GParted: GNOME Partition Editor
|
||||||
@ -72,6 +72,8 @@ Linux provides several tools for disk management:
|
|||||||
### a. Viewing disk information:
|
### a. Viewing disk information:
|
||||||
```
|
```
|
||||||
lsblk
|
lsblk
|
||||||
|
```
|
||||||
|
```
|
||||||
fdisk -l
|
fdisk -l
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -79,7 +81,7 @@ fdisk -l
|
|||||||
```
|
```
|
||||||
sudo fdisk /dev/sdX
|
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:
|
### c. Formatting a partition:
|
||||||
```
|
```
|
||||||
@ -109,7 +111,7 @@ LVM allows for more flexible disk management, including:
|
|||||||
- Creating snapshots
|
- Creating snapshots
|
||||||
|
|
||||||
### c. RAID (Redundant Array of Independent Disks):
|
### 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:
|
### d. Encrypting partitions:
|
||||||
Use LUKS (Linux Unified Key Setup) for full-disk encryption.
|
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.
|
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.
|
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/.)
|
|
||||||
|
|||||||
@ -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/.)
|
|
||||||
@ -143,11 +143,3 @@ This setup provides the redundancy of RAID 5 with the flexibility of LVM.
|
|||||||
- Display PV info: `sudo pvdisplay`
|
- Display PV info: `sudo pvdisplay`
|
||||||
- Display VG info: `sudo vgdisplay`
|
- Display VG info: `sudo vgdisplay`
|
||||||
- Display LV info: `sudo lvdisplay`
|
- 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.)
|
|
||||||
|
|||||||
@ -7,129 +7,94 @@ journalctl is a command-line utility for querying and displaying logs from the s
|
|||||||
## 2. Basic Usage
|
## 2. Basic Usage
|
||||||
|
|
||||||
### To view all logs:
|
### To view all logs:
|
||||||
```
|
`journalctl`
|
||||||
journalctl
|
|
||||||
```
|
|
||||||
|
|
||||||
### To follow new log entries in real-time:
|
### To follow new log entries in real-time:
|
||||||
```
|
`journalctl -f`
|
||||||
journalctl -f
|
|
||||||
```
|
|
||||||
|
|
||||||
## 3. Filtering Logs
|
## 3. Filtering Logs
|
||||||
|
|
||||||
### By time:
|
### By time:
|
||||||
```
|
`journalctl --since "2024-01-01 00:00:00"`
|
||||||
journalctl --since "2024-01-01 00:00:00"
|
|
||||||
journalctl --until "2024-01-31 23:59:59"
|
`journalctl --until "2024-01-31 23:59:59"`
|
||||||
journalctl --since "1 hour ago"
|
|
||||||
```
|
`journalctl --since "1 hour ago"`
|
||||||
|
|
||||||
|
|
||||||
### By service unit:
|
### By service unit:
|
||||||
```
|
`journalctl -u nginx.service`
|
||||||
journalctl -u nginx.service
|
|
||||||
journalctl -u ssh.service
|
`journalctl -u ssh.service`
|
||||||
```
|
|
||||||
|
|
||||||
### By priority level:
|
### By priority level:
|
||||||
```
|
`journalctl -p err`
|
||||||
journalctl -p err
|
|
||||||
```
|
|
||||||
Priority levels: emerg, alert, crit, err, warning, notice, info, debug
|
Priority levels: emerg, alert, crit, err, warning, notice, info, debug
|
||||||
|
|
||||||
### By kernel messages:
|
### By kernel messages:
|
||||||
```
|
`journalctl -k`
|
||||||
journalctl -k
|
|
||||||
```
|
|
||||||
|
|
||||||
## 4. Output Formatting
|
## 4. Output Formatting
|
||||||
|
|
||||||
### JSON output:
|
### JSON output:
|
||||||
```
|
`journalctl -o json`
|
||||||
journalctl -o json
|
|
||||||
```
|
|
||||||
|
|
||||||
### Short output format:
|
### Short output format:
|
||||||
```
|
`journalctl -o short`
|
||||||
journalctl -o short
|
|
||||||
```
|
|
||||||
|
|
||||||
### Verbose output:
|
### Verbose output:
|
||||||
```
|
`journalctl -o verbose`
|
||||||
journalctl -o verbose
|
|
||||||
```
|
|
||||||
|
|
||||||
## 5. Boot-specific Logs
|
## 5. Boot-specific Logs
|
||||||
|
|
||||||
### Current boot:
|
### Current boot:
|
||||||
```
|
`journalctl -b`
|
||||||
journalctl -b
|
|
||||||
```
|
|
||||||
|
|
||||||
### Previous boot:
|
### Previous boot:
|
||||||
```
|
`journalctl -b -1`
|
||||||
journalctl -b -1
|
|
||||||
```
|
|
||||||
|
|
||||||
## 6. User-specific Logs
|
## 6. User-specific Logs
|
||||||
|
|
||||||
```
|
`journalctl _UID=1000`
|
||||||
journalctl _UID=1000
|
|
||||||
```
|
|
||||||
|
|
||||||
## 7. Disk Usage and Log Rotation
|
## 7. Disk Usage and Log Rotation
|
||||||
|
|
||||||
### View disk usage:
|
### View disk usage:
|
||||||
```
|
`journalctl --disk-usage`
|
||||||
journalctl --disk-usage
|
|
||||||
```
|
|
||||||
|
|
||||||
### Rotate logs:
|
### Rotate logs:
|
||||||
```
|
`journalctl --rotate`
|
||||||
journalctl --rotate
|
|
||||||
```
|
|
||||||
|
|
||||||
### Vacuum old logs:
|
### Vacuum old logs:
|
||||||
```
|
`journalctl --vacuum-time=1week`
|
||||||
journalctl --vacuum-time=1week
|
|
||||||
journalctl --vacuum-size=1G
|
`journalctl --vacuum-size=1G`
|
||||||
```
|
|
||||||
|
|
||||||
## 8. Remote Journal Access
|
## 8. Remote Journal Access
|
||||||
|
|
||||||
To access logs on a remote system:
|
To access logs on a remote system:
|
||||||
```
|
`journalctl -D /path/to/journal/directory`
|
||||||
journalctl -D /path/to/journal/directory
|
|
||||||
```
|
|
||||||
|
|
||||||
## 9. Persistent Journal Storage
|
## 9. Persistent Journal Storage
|
||||||
|
|
||||||
### Edit /etc/systemd/journald.conf:
|
### Edit /etc/systemd/journald.conf:
|
||||||
```
|
`Storage=persistent`
|
||||||
Storage=persistent
|
|
||||||
```
|
|
||||||
|
|
||||||
### Restart journald:
|
### Restart journald:
|
||||||
```
|
`sudo systemctl restart systemd-journald`
|
||||||
sudo systemctl restart systemd-journald
|
|
||||||
```
|
|
||||||
|
|
||||||
## 10. Forwarding Logs to a Central Server
|
## 10. Forwarding Logs to a Central Server
|
||||||
|
|
||||||
### Install rsyslog:
|
### Install rsyslog:
|
||||||
```
|
`sudo apt install rsyslog`
|
||||||
sudo apt install rsyslog
|
|
||||||
```
|
|
||||||
|
|
||||||
### Configure /etc/rsyslog.conf for forwarding:
|
### Configure /etc/rsyslog.conf for forwarding:
|
||||||
```
|
`*.* @@central-log-server:514`
|
||||||
*.* @@central-log-server:514
|
|
||||||
```
|
|
||||||
|
|
||||||
### Restart rsyslog:
|
### Restart rsyslog:
|
||||||
```
|
`sudo systemctl restart rsyslog`
|
||||||
sudo systemctl restart rsyslog
|
|
||||||
```
|
|
||||||
|
|
||||||
## 11. Security Considerations
|
## 11. Security Considerations
|
||||||
|
|
||||||
|
|||||||
@ -36,12 +36,3 @@
|
|||||||
- Regularly back up important files to an external location.
|
- Regularly back up important files to an external location.
|
||||||
- Use tools like **rsync**, **Deja Dup**, or cloud storage services¹.
|
- 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.)
|
|
||||||
Loading…
x
Reference in New Issue
Block a user