Linux Terminal Glossary
›
VPS Management
VPS Management
336 commands
ssh root@203.0.113.10
ssh -p 22 user@203.0.113.10
ssh -i ~/.ssh/id_ed25519 user@203.0.113.10
ssh -L 5432:localhost:5432 user@203.0.113.10
ssh -L 8080:localhost:3000 user@203.0.113.10
ssh -N -f -L 5432:localhost:5432 user@203.0.113.10
adduser deploy && usermod -aG sudo deploy
mkdir -p ~/.ssh && chmod 700 ~/.ssh && touch ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys
echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJiYV8m9zKq6cQd2sEaXzWmRgTnBvLpNhJfCk3HtQa laptop' >> ~/.ssh/authorized_keys
sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
sudo apt install -y curl wget git unzip htop ufw fail2ban
sudo unattended-upgrades --dry-run
sudo dpkg --configure -a
sudo apt install -y software-properties-common
curl -4 ifconfig.me
curl -6 ifconfig.me
netplan apply
sudo nano /etc/netplan/00-installer-config.yaml
sudo netplan try
nslookup google.com
ss -tlnp | grep LISTEN | awk '{print $4, $6}'
df -h --output=source,size,used,avail,pcent,target
du -sh /* 2>/dev/null | sort -rh | head -20
iostat -x 1 3
vmstat -s
cat /proc/loadavg
sudo fdisk -l
sudo mkfs.ext4 /dev/vdb
sudo mount /dev/vdb /data
echo '/dev/vdb /data ext4 defaults 0 2' | sudo tee -a /etc/fstab
sudo mount -a
sudo resize2fs /dev/vda1
sudo fallocate -l 2G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo swapon --show
cat /proc/sys/vm/swappiness
sudo sysctl vm.swappiness=10
sudo journalctl -b -p err
sudo journalctl --disk-usage
sudo journalctl --vacuum-time=7d
sudo tail -f /var/log/syslog
sudo tail -f /var/log/auth.log
sudo grep 'Failed password' /var/log/auth.log | tail -20
lastb -n 20
sudo sysctl -w net.core.somaxconn=65535
sudo sysctl -w fs.file-max=2097152
ulimit -n
sudo nano /etc/sysctl.conf
sudo sysctl -p
ps aux --sort=-%mem | head -15
ps aux --sort=-%cpu | head -15
kill -9 PID
pkill -f 'node server.js'
nice -n 10 ./heavy-script.sh
renice -n 10 -p PID
sudo reboot
sudo shutdown -h now
sudo shutdown -r +5 'Rebooting for kernel update in 5 minutes'
sudo needs-restarting -r
cat /var/run/reboot-required
sudo poweroff
sudo apt install -y cloud-guest-utils
sudo growpart /dev/vda 1
curl -s https://packagecloud.io/AtomicCorp/atomic/installer/script.deb.sh | sudo bash
dd if=/dev/zero of=/tmp/testfile bs=1G count=1 oflag=dsync
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -
mtr --report --report-cycles 10 8.8.8.8
sysbench cpu --cpu-max-prime=20000 run
sudo lshw -short
ufw enable
ufw status verbose
ufw allow 22/tcp
ufw allow 80,443/tcp
ufw deny 23/tcp
ufw delete allow 22/tcp
ufw reload
ufw reset
firewall-cmd --state
firewall-cmd --list-all
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
nft add table inet filter
nft flush ruleset
iptables -L -n -v
iptables-save
fail2ban-client status
fail2ban-client status sshd
fail2ban-client set sshd unbanip 1.2.3.4
lynis audit system
rkhunter --check
chkrootkit
clamscan -r /var/www
freshclam
auditctl -l
ausearch -k sshd
aureport -au
aa-status
aa-enforce /etc/apparmor.d/usr.sbin.nginx
getenforce
setenforce 1
sestatus
semanage port -l
restorecon -Rv /var/www
chcon -t httpd_sys_content_t /srv/site
getcap -r / 2>/dev/null
setcap cap_net_bind_service=+ep /usr/local/bin/app
unshare -n bash
nsenter --target 1234 --mount --uts --ipc --net --pid
debsums -s
debscan
needrestart -r a
certbot --nginx -d example.com
certbot --apache -d example.com
certbot renew --dry-run
certbot certificates
certbot delete --cert-name example.com
openssl s_client -connect example.com:443 -servername example.com
openssl req -new -newkey rsa:4096 -nodes -keyout server.key -out server.csr
openssl x509 -in server.crt -text -noout
openssl verify -CAfile chain.pem server.crt
openssl pkcs12 -info -in bundle.p12
nginx -t
nginx -s reload
apache2ctl configtest
apache2ctl -S
a2ensite example.conf
a2dissite example.conf
a2enmod rewrite
php-fpm8.2 -t
supervisorctl status
supervisorctl restart all
postfix status
postfix reload
mailq
postqueue -p
postsuper -d ALL
postconf -n
mail -s 'test' admin@example.com
mutt
redis-cli ping
redis-cli info memory
redis-cli monitor
redis-cli save
redis-cli flushdb
redis-cli latency doctor
mysqlcheck --all-databases
mysqloptimize --all-databases
pg_basebackup -D /backups/pgbase -Fp -Xs -P
pg_lsclusters
mongodump --out /backups/mongo
mongorestore /backups/mongo
restic init
restic backup /etc /var/www
restic snapshots
restic restore latest --target /restore
restic check
restic forget --keep-daily 7 --prune
duplicity /etc file:///backup/duplicity
ddrescue /dev/sdb image.dd rescue.log
testdisk
lnav /var/log/syslog
multitail -f /var/log/syslog /var/log/auth.log
goaccess access.log -o report.html
logwatch --detail High --service all --range today
pflogsumm /var/log/mail.log
ansible all -m ping
ansible-playbook site.yml
ansible-inventory --list
ansible-vault encrypt secrets.yml
ansible-galaxy install -r requirements.yml
terraform init
terraform plan
terraform apply
terraform destroy
puppet apply site.pp
podman ps
buildah bud -t app:latest .
skopeo inspect docker://docker.io/library/nginx:latest
kubectl get pods -A
kubectl describe pod mypod -n default
kubectl logs deploy/web -n default
kubectl exec -it deploy/web -n default -- sh
kubectl apply -f manifest.yaml
kubectl delete -f manifest.yaml
kubectl scale deploy/web --replicas=3
kubectl rollout status deploy/web
helm list -A
helm install web chart/ -n default
helm upgrade web chart/ -n default
helm rollback web 1 -n default
helm uninstall web -n default
lxc list
lxc start web01
lxc stop web01
lxc exec web01 -- bash
virsh list --all
virsh dominfo web01
virt-install --name web01 --memory 2048 --vcpus 2 --disk size=20 --cdrom image.iso
qemu-img info disk.qcow2
qemu-img create -f qcow2 disk.qcow2 20G
ssh root@203.0.113.10
ssh -o StrictHostKeyChecking=accept-new root@203.0.113.10
sudo apt update && sudo apt upgrade -y
sudo apt upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
sudo apt-get update -o Acquire::Retries=3
sudo apt install -y ufw fail2ban unattended-upgrades curl htop
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y ufw fail2ban unattended-upgrades curl htop
sudo apt-get install -y linux-headers-$(uname -r)
sudo apt install -y btop
sudo timedatectl set-timezone UTC
sudo dpkg-reconfigure --frontend noninteractive unattended-upgrades
sudo ufw allow OpenSSH
sudo ufw allow proto tcp to any port 80,443 comment 'web traffic'
sudo ufw limit 22/tcp comment 'SSH rate limit'
sudo ufw delete 3
sudo ufw app info OpenSSH
sudo ufw insert 1 deny from 203.0.113.99
sudo ufw --dry-run allow 8080/tcp
sudo ufw allow from 198.51.100.0/24 to any port 22 proto tcp comment 'office ssh'
sudo ufw reject 23/tcp
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.$(date +%F)
sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
sudo sed -i 's/^#PubkeyAuthentication.*/PubkeyAuthentication yes/' /etc/ssh/sshd_config
sudo sed -i 's/^#PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config
sudo sshd -t -f /etc/ssh/sshd_config
sudo sshd -T | grep -iE 'permitrootlogin|passwordauthentication|pubkeyauthentication'
sudo systemctl restart ssh
sudo systemctl status ssh --no-pager
sudo systemctl is-active ssh
sudo systemctl is-enabled ssh
ssh -o PasswordAuthentication=no root@203.0.113.10
ssh -p 22 -i ~/.ssh/id_ed25519 deploy@203.0.113.10
ssh -o ServerAliveInterval=60 deploy@203.0.113.10
ssh -A deploy@203.0.113.10
ssh -J bastion.example.com deploy@203.0.113.10
ssh -t deploy@203.0.113.10 sudo systemctl status nginx
ssh -G deploy@203.0.113.10
ssh-keyscan -t ed25519 203.0.113.10 >> ~/.ssh/known_hosts
scp -P 22 -i ~/.ssh/id_ed25519 deploy.tar.gz deploy@203.0.113.10:/home/deploy/
sudo adduser --disabled-password --gecos '' deploy
sudo sed -i 's/^#AllowUsers.*/AllowUsers deploy/' /etc/ssh/sshd_config
sudo sed -i 's/^#MaxAuthTries.*/MaxAuthTries 3/' /etc/ssh/sshd_config
sudo sed -i 's/^#ClientAliveInterval.*/ClientAliveInterval 300/' /etc/ssh/sshd_config
ssh -o ExitOnForwardFailure=yes -L 3000:localhost:3000 deploy@203.0.113.10
ssh-add -L
nano ~/.ssh/config
sudo fail2ban-client restart
sudo fail2ban-client set sshd maxretry 5
sudo fail2ban-client set sshd findtime 600
sudo fail2ban-client set sshd addignoreip 192.0.2.10
sudo fail2ban-client set sshd delignoreip 192.0.2.10
sudo fail2ban-client get sshd maxretry
sudo fail2ban-client status sshd | grep -E 'Currently banned|Banned IP list'
sudo fail2ban-client status | grep 'Jail list'
sudo fail2ban-client set sshd banip 203.0.113.5
sudo fail2ban-client set sshd unbanip 203.0.113.5
sudo fail2ban-client status sshd short
sudo fail2ban-client stats
sudo tail -f /var/log/fail2ban.log
sudo grep -E '^(bantime|findtime|maxretry)' /etc/fail2ban/jail.local
sudo systemctl enable --now fail2ban
sudo systemctl reload fail2ban
sudo unattended-upgrade
sudo unattended-upgrade --dry-run
sudo unattended-upgrade -d
sudo grep -n 'Automatic-Reboot' /etc/apt/apt.conf.d/50unattended-upgrades
sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
sudo tail -n 30 /var/log/unattended-upgrades/unattended-upgrades.log
sudo systemctl status unattended-upgrades
sudo systemctl restart unattended-upgrades
sudo systemctl status apt-daily-upgrade.timer
sudo systemctl mask apt-daily-upgrade.timer
sudo systemctl unmask apt-daily-upgrade.timer
sudo apt list --upgradable | grep -v '^Listing'
sudo apt-get -s upgrade | grep -c '^Inst'
sudo do-release-upgrade
sudo apt-get dist-upgrade
sudo shutdown -r now
sudo apt install -y apt-listchanges
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapoff /swapfile
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
sudo sysctl -w vm.swappiness=10
sudo sysctl --system
git clone https://github.com/example/myapp.git /opt/myapp
sudo mkdir -p /opt/myapp && sudo chown deploy:deploy /opt/myapp
cd /opt/myapp && sudo npm ci --omit=dev
sudo -u deploy bash -lc 'cd /opt/myapp && npm ci --omit=dev && npm run build'
sudo systemctl enable --now myapp.service
sudo systemctl restart myapp
sudo systemctl status myapp --no-pager -l
sudo systemctl reset-failed myapp
sudo systemctl cat myapp
sudo systemctl show myapp -p MainPID
journalctl -u myapp -f
journalctl -u myapp -n 100 --no-pager
sudo journalctl -u myapp --since today -p warning
sudo nginx -t && sudo systemctl reload nginx
sudo apt install -y nginx
cd /opt/myapp && git pull --ff-only origin main && sudo systemctl restart myapp
sudo -u deploy git -C /opt/myapp pull origin main
git -C /opt/myapp rev-parse --short HEAD
git -C /opt/myapp log --oneline -5
ssh deploy@203.0.113.10 'cd /opt/myapp && git pull && sudo systemctl restart myapp'
sudo systemctl restart myapp && sleep 3 && curl -sf http://localhost:3000/health && echo DEPLOY_OK
sudo mkdir -p /var/www/example.com/html
sudo chown -R www-data:www-data /var/www/example.com
curl -I https://example.com | grep -iE '^HTTP'
sudo nginx -T | grep -E 'server_name|listen'
sudo systemctl daemon-reload && sudo systemctl restart myapp
sudo certbot renew --cert-name example.com
sudo certbot renew --quiet --deploy-hook 'systemctl reload nginx'
sudo certbot renew --standalone --pre-hook 'systemctl stop nginx' --post-hook 'systemctl start nginx'
15 3 * * * /usr/bin/certbot renew --quiet --deploy-hook 'systemctl reload nginx'
sudo certbot certonly --nginx --cert-name example.com -d example.com -d www.example.com
sudo certbot certificates | grep -E 'Certificate Name|Expiry Date'
sudo certbot reconfigure --cert-name example.com
sudo crontab -e
sudo crontab -l
crontab -l | grep -v '^#'
systemctl list-timers --all | grep -iE 'apt|unattended|certbot'
sudo tar -czf /root/backups/etc-$(date +%F).tar.gz /etc/ssh /etc/ufw /etc/fail2ban
sudo journalctl -b -1 -p err
sudo journalctl -u ssh -b | grep -i 'failed password'
sudo grep 'Accepted publickey' /var/log/auth.log | tail -10
last -x shutdown reboot
sudo ss -tlnp | grep :22
sudo apt-get autoremove --purge -y
sudo du -sh /var/log/* | sort -rh | head -10
sudo lsof -iTCP -sTCP:LISTEN -P -n
sudo visudo -f /etc/sudoers.d/deploy
Search all 7,657 commands
instead.