Set Up SSH Key Authentication
# Generate a new SSH key pair (without passphrase for automation)
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N ""
# Copy public key to the remote server
ssh-copy-id user@remote_host
Encrypt a File Using OpenSSL
# Encrypt
openssl enc -aes-256-cbc -salt -in myfile.txt -out myfile.txt.enc
# Decrypt
openssl enc -aes-256-cbc -d -in myfile.txt.enc -out myfile.txt
Inspect IP Tables (Firewall Rules)
# List all firewall rules
sudo iptables -L -v -n
# Save current firewall rules
sudo iptables-save > /etc/iptables/rules.v4