/Linux-Administrator

Linux-Administrator Commands and Practices

Linux Administration

Linux is a tried-and-true, open-source operating system released in 1991 for computers, but its use has expanded to underpin systems for cars, phones, web servers and, more recently, networking gear


Network-Tools

  1. Traceroute is a network diagnostic tool used to track in real-time the pathway taken by a packet on an IP network from source to destination, reporting the IP addresses of all the routers it pinged in between. Traceroute also records the time taken for each hop the packet makes during its route to the destination.

    caveats-of-popular-network-tools-traceroute

  2. NetFlow is a protocol developed by Cisco Systems to record all IP traffic flows traversing a router or switch that is NetFlow enabled. It generates statistics inside these devices at the interface level and sends this information in UDP-based flow records to an external element called a flow collector—a program running on a server where the traffic statistics can be stored for load balancing analysis.

  3. Real-time diagnostics of Unix/Linux problems

    Identify congested areas and swiftly respond to issues before they impact users with this performance and diagnostics resolution tool. Get real-time data flow from Solaris, AIX, HPUX, and Unix/Linux operating systems (including I/O subsystem, cache and kernel information). Create thresholds with an automatically generated set of normal baseline activity for each system, and send alerts about impending problems.


Pentesting Tools


Documentation

  1. 34 Basic Linux Commands Every User Should Know

  2. How to Create Users in Linux

  3. userdel command in Linux with Examples

  4. Syslog and Klog

  5. The magic behind configure, make, make install

  6. Linux tr Command with Examples

  7. What is SELinux?

  8. In Linux, what do all the values in the "top" command mean?

  9. How to Create a New Sudo User & Manage Sudo Access on Ubuntu 20.04

  10. Vim Keyboard Shortcuts

  11. Vim Cheat Sheet


Questions

  1. What's the difference of dmesg output and /var/log/messages ?

    dmesg prints the contents of the ring buffer. This information is also sent in real time to syslogd or klogd, when they are running, and ends up in /var/log/messages; when dmesg is most useful is in capturing boot-time messages from before syslogd and/or klogd started, so that they will be properly logged.

    whats-the-difference-of-dmesg-output-and-var-log-messages

  2. How To Solve “XFS: Filesystem has duplicate UUID – can’t mount”

    $ sudo mount -o rw,nouuid /dev/sda3 /mnt

    $ sudo xfs_admin -U generate /dev/sda3

  3. How do I find all files containing specific text on Linux?

find / -type f -exec grep -H 'text-to-find-here' {} ;

  1. How to fix SSH Permission denied sudo nano /etc/ssh/sshd_config

  2. VIM add sudo rights :w !sudo tee %

  3. calculate the CPU usage using vmstat echo "CPU Usage: "$[100-$(vmstat 1 2|tail -1|awk '{print $15}')]"%"

  4. Forgot Linux Password on WSL?

ubuntu config --default-user root

  1. Bash help declear bash -c help

  2. Extend a Linux file system after resizing a volume

sudo growpart /dev/nvme0n1 1

sudo resize2fs /dev/nvme0n1p1

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html

https://aws.amazon.com/premiumsupport/knowledge-center/ebs-volume-size-increase/

No space left on the block device

$ sudo mount -o size=10M,rw,nodev,nosuid -t tmpfs tmpfs /tmp

chroot /host