Here are links to some useful Linux tips:
https://www.cyberciti.biz/faq/linux-unix-appleosx-bsd-cat-command-examples/
https://peteris.rocks/blog/htop/
https://www.cyberciti.biz/faq/searching-multiple-words-string-using-grep/
https://www.cyberciti.biz/faq/using-sed-to-delete-empty-lines/
https://www.cyberciti.biz/faq/linux-hide-processes-from-other-users/
https://www.cyberciti.biz/faq/bash-check-if-process-is-running-or-notonlinuxunix/
https://www.cyberciti.biz/faq/unix-linux-bsd-appleosx-bash-assign-variable-command-output/
https://bash.cyberciti.biz/file-management/linux-shell-script-to-reduce-pdf-file-size/
https://www.cyberciti.biz/faq/bash-file-command-not-found-how-to-install-file/
https://www.cyberciti.biz/faq/set-up-a-basic-iptables-firewall-on-amazon-linux-ami/
https://www.cyberciti.biz/faq/fedora-redhat-centos-5-6-disable-firewall/
https://hackertarget.com/ossec-introduction-and-installation-guide/
Awesome. VIM “for people who don’t want to use it , but have to…”. Or see my page https://www.cyberciti.biz/faq/linux-unix-vim-save-and-quit-command/
sudo is the right choice for granting admin rights on the CentOS Linux 8 server. Learn how to create a new user and grant her admin rights https://www.cyberciti.biz/faq/add-create-a-sudo-user-on-centos-linux-8/
638 Comments
Tomi Engdahl says:
SSH ProxyCommand example: Going through one host to reach another server https://www.cyberciti.biz/faq/linux-unix-ssh-proxycommand-passing-through-one-host-gateway-server/ #Linux #Unix #macOS #SysAdmin #DevOps
Tomi Engdahl says:
Bash is one of the most popular shells for Linux/Unix users and developers. It just got better with a new version that includes enhanced random number generation. Let us take a quick look at new features and learn how to install the latest GNU/BASH 5.1. https://www.cyberciti.biz/linux-news/gnu-bash-5-1-released-with-the-random-srandom-number-engine/
Tomi Engdahl says:
Want to run commands as another user on your Linux desktop or server? Try su, sudo, kpexec, and runuser commands. https://www.cyberciti.biz/open-source/command-line-hacks/linux-run-command-as-different-user/
Tomi Engdahl says:
//How to install xfs and create xfs file system on Debian/Ubuntu Linux https://www.cyberciti.biz/faq/how-to-install-xfs-and-create-xfs-file-system-on-debianubuntu-linux/
Tomi Engdahl says:
With its 288 RGB LEDs, this Arduino-controlled cylinder puts on quite the show! https://bit.ly/3gHNtOS
Tomi Engdahl says:
Beginner’s Guide to Analyzing Logs in Linux With journalctl Command
Beginner’s guide to using journalctl commands for viewing, filtering and analyzing journal logs in Linux.
https://linuxhandbook.com/journalctl-command/
Tomi Engdahl says:
//Did you know you can colorize and print all IP addresses and interfaces on Linux in a tabular format for better readability?
ip -br -c addr show
ip -br -c link show
See our ip command guide https://www.cyberciti.biz/faq/linux-ip-command-examples-usage-syntax/ pretty cool, huh? #Linux #SysAdmin #devops
Tomi Engdahl says:
# bpytop – Awesome Linux, macOS and FreeBSD resource monitor https://www.cyberciti.biz/open-source/command-line-hacks/bpytop-awesome-linux-macos-and-freebsd-resource-monitor/ #Linux #freebsd #MacOs #python
Tomi Engdahl says:
https://www.tecmint.com/linux-package-managers/
Tomi Engdahl says:
How to update OpenSUSE Linux software and kernel using CLI https://www.cyberciti.biz/faq/update-opensuse-linux-software-kernel-command/
Tomi Engdahl says:
//{Updated} In this in-depth tutorial, we will explain to read, list and set environment and shell variables on Linux including read-only and persistent configs. https://www.cyberciti.biz/faq/set-environment-variable-linux/ #sysadmin #Linux #programming
Tomi Engdahl says:
https://www.facebook.com/126000117413375/posts/4137677076245639/
Tomi Engdahl says:
https://www.facebook.com/126000117413375/posts/4137677076245639/
//Do you want to see a list or find open ports on your server from Linux, macOS, FreeBSD or Unix-like systems when Nmap is not installed? Try netcat/nc command. It is simple yet effective for offensive and defensive purposes. No root access needed:
nc -w1 -zv your-server-ip 1-1023 2>&1 | grep succeeded
See https://www.cyberciti.biz/faq/linux-port-scanning/ for more info.
Tomi Engdahl says:
How to secure Lighttpd with Let’s Encrypt TLS/SSL certificate on Debian/Ubuntu Linux https://www.cyberciti.biz/faq/how-to-configure-lighttpd-web-server-with-free-lets-encrypt-ssl-certificate-on-debian-or-ubuntu-linux/
Tomi Engdahl says:
A bash script that will automatically install a list of bug hunting tools that I find interesting for recon, exploitation, etc. (minus burp) For Ubuntu/Debain. Feel free to fork, and add your own tools.
https://github.com/0xApt/awesome-bbht
Tomi Engdahl says:
//Display http/ftp status code from Linux, macOS and Unix-like systems. Useful to see if a remote website is up or down without using 3rd party service. HTTP/200 means up and running:
curl -L -o /dev/null -s -I -w ‘%{http_code}\n’ url
See https://www.cyberciti.biz/faq/curl-hide-progress-bar-output-linux-unix-macos/ for more examples.
Tomi Engdahl says:
// Learn how to configure Intel WiFi on Debian Linux 10 or 11 when you need a binary blob.
https://www.cyberciti.biz/faq/intel-wifi-on-debian-linux-when-you-get-firmware-failed-to-load-iwlwifi-8265-36-error/ #sysadmi #Debian #Linux
Tomi Engdahl says:
//This page explains how to change/update your LUKS disk encryption passphrase when you initially set a weak passphrase that protects your Linux disk data. Useful for rotating passphrase is also good security practice.
https://www.cyberciti.biz/security/how-to-change-luks-disk-encryption-passphrase-in-linux/ #Linux #Sysadmin #IT #security
Tomi Engdahl says:
Let us start a flame fest over a text editor: Top six awesome text/CLI editors for Linux, macOS and Unix devs/users. https://www.cyberciti.biz/open-source/awesome-text-editors-for-linux-and-unix-command-line-users-developers/ #programming #UNIX #Linux #SysAdmin #MacOS #bsd
Tomi Engdahl says:
//Rolling back to the previous version may solve the problem or free the disk space. Both CentOS/RHEL support rollback feature, but I learned hard way both Debian and Ubuntu Linux does not support rollback feature yet. https://www.cyberciti.biz/howto/debian-linux/ubuntu-linux-rollback-an-apt-get-upgrade/ #sysadmin
Tomi Engdahl says:
https://www.cyberciti.biz/faq/restart-centos-rhel-safely-and-gracefully/
Tomi Engdahl says:
https://www.cyberciti.biz/open-source/command-line-hacks/bpytop-awesome-linux-macos-and-freebsd-resource-monitor/
Tomi Engdahl says:
https://www.redhat.com/sysadmin/linux-command-basics-7-commands-process-management
Tomi Engdahl says:
//Ubuntu 20.04 add network bridge (br0) with nmcli command https://www.cyberciti.biz/faq/ubuntu-20-04-add-network-bridge-br0-with-nmcli-command/ #Linux #SysAdmin
Tomi Engdahl says:
Learn how to use tar over ssh for moving files securely, quick backups and more.
https://www.cyberciti.biz/faq/howto-use-tar-command-through-network-over-ssh-session/ #Linux #UNIX #macOS #Sysadmin #devlife
Tomi Engdahl says:
How to Get Persistent SSH Connections in Linux Using Eternal Terminal
https://www.tomshardware.com/how-to/persistent-ssh-connections-linux-eternal-terminal
Tomi Engdahl says:
//tuptime – Linux See Historical and Statistical Uptime of System https://www.cyberciti.biz/hardware/howto-see-historical-statistical-uptime-on-linux-server/ Works on both #Linux and #FreeBSD.
Tomi Engdahl says:
//How to issue Let’s Encrypt wildcard certificate with acme.sh and Cloudflare DNS https://www.cyberciti.biz/faq/issue-lets-encrypt-wildcard-certificate-with-acme-sh-and-cloudflare-dns/ Are you using AWS route 53 DNS? See how use Route 53 to get Let’s Encrypt wildcard certificate with acme.sh and DNS auth https://www.cyberciti.biz/faq/route-53-lets-encrypt-wildcard-certificate-with-acme-sh/
Tomi Engdahl says:
Did you know? You can allows processes/services to bind() to non-local IP addresses, which can be quite useful for application such as load balancer such as Nginx, HAProxy, keepalived, WireGuard, OpenVPN and others during boot time on Linux. https://www.cyberciti.biz/faq/linux-bind-ip-that-doesnt-exist-with-net-ipv4-ip_nonlocal_bind/
Tomi Engdahl says:
//perl and egep problem for Linux and Unix users. You may find my Regular expressions in grep ( regex ) with examples handy https://www.cyberciti.biz/faq/grep-regular-expressions/
Tomi Engdahl says:
//Want to see a sorted list of your top 10 directory sizes that is eating your disk space on Linux or FreeBSD/macOS? Try:
du -sh * | sort -h | tail -10
See https://www.cyberciti.biz/faq/how-do-i-find-the-largest-filesdirectories-on-a-linuxunixbsd-filesystem/ or other CLI tricks or techniques to find largest top 10 files and directories on your box. #Linux #Unix #macOS #freebsd
Tomi Engdahl says:
Pretty pi-hole blocking bad stuff via DNS. See how to set up PI-HOLE https://www.cyberciti.biz/faq/ubuntu-linux-install-pi-hole-with-a-openvpn/ Via https://www.reddit.com/r/raspberry_pi/comments/kvb1ia/dont_talk_to_me_or_my_son_ever_again/
Tomi Engdahl says:
https://www.cyberciti.biz/tips/linux-find-out-wireless-network-speed-signal-strength.html
Tomi Engdahl says:
//Yet another fancy and fantastic looking tool called duf to display statistics on free disk space in Unix, Linux, macOS, *BSD, Android, and Windows written in Golang.https://www.cyberciti.biz/open-source/command-line-hacks/duf-disk-usage-free-utility-for-linux-bsd-macos-windows/ #Linux #macOS #unix
Tomi Engdahl says:
//Let us see how to improve your bash/sh/ksh/dash shell script with ShellCheck lint script analysis tool on Linux or FreeBSD unix system https://www.cyberciti.biz/faq/how-to-install-shellcheck-on-freebsd-to-analysis-scripts/
Tomi Engdahl says:
8 tips for the Linux command line
Take advantage of all of the powers the almighty Linux command line has to offer.
https://opensource.com/article/21/1/linux-commands
Tomi Engdahl says:
Linux bind IP that doesn’t exist with net.ipv4.ip_nonlocal_bind
https://www.cyberciti.biz/faq/linux-bind-ip-that-doesnt-exist-with-net-ipv4-ip_nonlocal_bind/
Tomi Engdahl says:
//Bash is usually the default shell on Linux desktop and used be default on macOS too. Here are useful keyboard shortcuts. More at https://bash.cyberciti.biz/guide/Main_Page
Tomi Engdahl says:
https://www.cyberciti.biz/faq/how-to-install-shellcheck-on-freebsd-to-analysis-scripts/
Tomi Engdahl says:
https://www.techrepublic.com/article/how-to-quickly-check-to-see-if-your-linux-server-is-under-a-ddos-attack-from-a-single-ip-address/#ftag=RSS-03-10aaa0b
Tomi Engdahl says:
//How to force awk not to print a newline https://www.cyberciti.biz/faq/awk-dont-print-newline-on-linux-unix-macos/
Tomi Engdahl says:
FYI, we can keep SSH connection alive when OpenSSH server drops you out after few minutes of inactivity https://www.cyberciti.biz/tips/open-ssh-server-connection-drops-out-after-few-or-n-minutes-of-inactivity.html
Tomi Engdahl says:
Mosh (mobile shell): Remote terminal application that allows roaming, supports intermittent connectivity and provides intelligent local echo and line editing of user keystrokes.
Mosh is a replacement for interactive SSH terminals. It’s more robust and responsive, especially over Wi-
Fi, cellular, and long-distance links.
Mosh is free software, available for GNU/Linux, BSD, macOS, Solaris, Android, Chrome, and iOS.
https://mosh.org/
Tomi Engdahl says:
https://www.makeuseof.com/what-is-ssh/?utm_source=MUO-FB-P&utm_medium=Social-Distribution&utm_campaign=MUO-FB-P
Tomi Engdahl says:
https://www.cyberciti.biz/faq/linux-list-disk-partitions-command/
Tomi Engdahl says:
https://www.tecmint.com/linux-iptables-firewall-rules-examples-commands/
Tomi Engdahl says:
https://hackaday.com/2021/02/11/linux-fu-serial-untethered/
Tomi Engdahl says:
Some Linux distros and even different kernel versions within a distro have disabled IRQ time accounting. In such case, your monitoring tools will report zero time spent in hardware interrupt handlers (shown as %hi, %irq, hiq, etc). It’s easy to check how your kernel is behaving by looking at /proc/stat and you can still measure interrupt CPU usage using perf and a little creativity.
Is Your Linux Version Hiding Interrupt CPU Usage From You?
https://tanelpoder.com/posts/linux-hiding-interrupt-cpu-usage/
Tomi Engdahl says:
Suraj Kushwah’s Google-Powered Tuxi Is Like an Alexa, Cortana, or Siri for Your Terminal Window
Tuxi the text-based assistant takes your natural language queries at the terminal and answers them using Google’s in-results infoboxes.
https://www.hackster.io/news/suraj-kushwah-s-google-powered-tuxi-is-like-an-alexa-cortana-or-siri-for-your-terminal-window-f44ae121f52e
Tomi Engdahl says:
Linux Fu: Shell Script File Embedding
https://hackaday.com/2021/04/09/linux-fu-shell-script-file-embedding/
You need to package up a bunch of files, send them somewhere, and do something with them at the destination. It isn’t an uncommon scenario. The obvious answer is to create an archive — a zip or tar file, maybe — and include a shell script that you have to tell the user to run after unpacking.
That may be obvious, but it assumes a lot on the part of the remote user.
They need to know how to unpack the file and they also need to know to run your magic script of commands after the unpack. However, you can easily create a shell script that contains a file — even an archive of many files — and then retrieve the file and act on it at run time. This is much simpler from the remote user’s point of view. You get one file, you execute it, and you are done.
In theory, this isn’t that hard to do, but there are a lot of details. Shell scripts are not compiled — at least, not typically — so the shell only reads what it needs to do the work. That means if your script is careful to exit, you can add as much “garbage” to the end of it as you like. The shell will never look at it, so it’s possible to store the payload there.
Script Doctor
While bash scripting is often maligned and not without reason, it is very flexible and powerful, as this example shows. It is dead easy to embed files in a script and that opens up a lot of flexible options for distributing complex file setups and applications.