VPS Management

336 commands

ssh root@203.0.113.10ssh -p 22 user@203.0.113.10ssh -i ~/.ssh/id_ed25519 user@203.0.113.10ssh -L 5432:localhost:5432 user@203.0.113.10ssh -L 8080:localhost:3000 user@203.0.113.10ssh -N -f -L 5432:localhost:5432 user@203.0.113.10adduser deploy && usermod -aG sudo deploymkdir -p ~/.ssh && chmod 700 ~/.ssh && touch ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keysecho 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJiYV8m9zKq6cQd2sEaXzWmRgTnBvLpNhJfCk3HtQa laptop' >> ~/.ssh/authorized_keyssed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_configsed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_configsudo apt update && sudo apt upgrade -y && sudo apt autoremove -ysudo apt install -y curl wget git unzip htop ufw fail2bansudo unattended-upgrades --dry-runsudo dpkg --configure -asudo apt install -y software-properties-commoncurl -4 ifconfig.mecurl -6 ifconfig.menetplan applysudo nano /etc/netplan/00-installer-config.yamlsudo netplan trynslookup google.comss -tlnp | grep LISTEN | awk '{print $4, $6}'df -h --output=source,size,used,avail,pcent,targetdu -sh /* 2>/dev/null | sort -rh | head -20iostat -x 1 3vmstat -scat /proc/loadavgsudo fdisk -lsudo mkfs.ext4 /dev/vdbsudo mount /dev/vdb /dataecho '/dev/vdb /data ext4 defaults 0 2' | sudo tee -a /etc/fstabsudo mount -asudo resize2fs /dev/vda1sudo fallocate -l 2G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfileecho '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstabsudo swapon --showcat /proc/sys/vm/swappinesssudo sysctl vm.swappiness=10sudo journalctl -b -p errsudo journalctl --disk-usagesudo journalctl --vacuum-time=7dsudo tail -f /var/log/syslogsudo tail -f /var/log/auth.logsudo grep 'Failed password' /var/log/auth.log | tail -20lastb -n 20sudo sysctl -w net.core.somaxconn=65535sudo sysctl -w fs.file-max=2097152ulimit -nsudo nano /etc/sysctl.confsudo sysctl -pps aux --sort=-%mem | head -15ps aux --sort=-%cpu | head -15kill -9 PIDpkill -f 'node server.js'nice -n 10 ./heavy-script.shrenice -n 10 -p PIDsudo rebootsudo shutdown -h nowsudo shutdown -r +5 'Rebooting for kernel update in 5 minutes'sudo needs-restarting -rcat /var/run/reboot-requiredsudo poweroffsudo apt install -y cloud-guest-utilssudo growpart /dev/vda 1curl -s https://packagecloud.io/AtomicCorp/atomic/installer/script.deb.sh | sudo bashdd if=/dev/zero of=/tmp/testfile bs=1G count=1 oflag=dsynccurl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -mtr --report --report-cycles 10 8.8.8.8sysbench cpu --cpu-max-prime=20000 runsudo lshw -shortufw enableufw status verboseufw allow 22/tcpufw allow 80,443/tcpufw deny 23/tcpufw delete allow 22/tcpufw reloadufw resetfirewall-cmd --statefirewall-cmd --list-allfirewall-cmd --add-service=http --permanentfirewall-cmd --reloadnft add table inet filternft flush rulesetiptables -L -n -viptables-savefail2ban-client statusfail2ban-client status sshdfail2ban-client set sshd unbanip 1.2.3.4lynis audit systemrkhunter --checkchkrootkitclamscan -r /var/wwwfreshclamauditctl -lausearch -k sshdaureport -auaa-statusaa-enforce /etc/apparmor.d/usr.sbin.nginxgetenforcesetenforce 1sestatussemanage port -lrestorecon -Rv /var/wwwchcon -t httpd_sys_content_t /srv/sitegetcap -r / 2>/dev/nullsetcap cap_net_bind_service=+ep /usr/local/bin/appunshare -n bashnsenter --target 1234 --mount --uts --ipc --net --piddebsums -sdebscanneedrestart -r acertbot --nginx -d example.comcertbot --apache -d example.comcertbot renew --dry-runcertbot certificatescertbot delete --cert-name example.comopenssl s_client -connect example.com:443 -servername example.comopenssl req -new -newkey rsa:4096 -nodes -keyout server.key -out server.csropenssl x509 -in server.crt -text -nooutopenssl verify -CAfile chain.pem server.crtopenssl pkcs12 -info -in bundle.p12nginx -tnginx -s reloadapache2ctl configtestapache2ctl -Sa2ensite example.confa2dissite example.confa2enmod rewritephp-fpm8.2 -tsupervisorctl statussupervisorctl restart allpostfix statuspostfix reloadmailqpostqueue -ppostsuper -d ALLpostconf -nmail -s 'test' admin@example.commuttredis-cli pingredis-cli info memoryredis-cli monitorredis-cli saveredis-cli flushdbredis-cli latency doctormysqlcheck --all-databasesmysqloptimize --all-databasespg_basebackup -D /backups/pgbase -Fp -Xs -Ppg_lsclustersmongodump --out /backups/mongomongorestore /backups/mongorestic initrestic backup /etc /var/wwwrestic snapshotsrestic restore latest --target /restorerestic checkrestic forget --keep-daily 7 --pruneduplicity /etc file:///backup/duplicityddrescue /dev/sdb image.dd rescue.logtestdisklnav /var/log/syslogmultitail -f /var/log/syslog /var/log/auth.loggoaccess access.log -o report.htmllogwatch --detail High --service all --range todaypflogsumm /var/log/mail.logansible all -m pingansible-playbook site.ymlansible-inventory --listansible-vault encrypt secrets.ymlansible-galaxy install -r requirements.ymlterraform initterraform planterraform applyterraform destroypuppet apply site.pppodman psbuildah bud -t app:latest .skopeo inspect docker://docker.io/library/nginx:latestkubectl get pods -Akubectl describe pod mypod -n defaultkubectl logs deploy/web -n defaultkubectl exec -it deploy/web -n default -- shkubectl apply -f manifest.yamlkubectl delete -f manifest.yamlkubectl scale deploy/web --replicas=3kubectl rollout status deploy/webhelm list -Ahelm install web chart/ -n defaulthelm upgrade web chart/ -n defaulthelm rollback web 1 -n defaulthelm uninstall web -n defaultlxc listlxc start web01lxc stop web01lxc exec web01 -- bashvirsh list --allvirsh dominfo web01virt-install --name web01 --memory 2048 --vcpus 2 --disk size=20 --cdrom image.isoqemu-img info disk.qcow2qemu-img create -f qcow2 disk.qcow2 20Gssh root@203.0.113.10ssh -o StrictHostKeyChecking=accept-new root@203.0.113.10sudo apt update && sudo apt upgrade -ysudo apt upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"sudo apt-get update -o Acquire::Retries=3sudo apt install -y ufw fail2ban unattended-upgrades curl htopsudo DEBIAN_FRONTEND=noninteractive apt-get install -y ufw fail2ban unattended-upgrades curl htopsudo apt-get install -y linux-headers-$(uname -r)sudo apt install -y btopsudo timedatectl set-timezone UTCsudo dpkg-reconfigure --frontend noninteractive unattended-upgradessudo ufw allow OpenSSHsudo ufw allow proto tcp to any port 80,443 comment 'web traffic'sudo ufw limit 22/tcp comment 'SSH rate limit'sudo ufw delete 3sudo ufw app info OpenSSHsudo ufw insert 1 deny from 203.0.113.99sudo ufw --dry-run allow 8080/tcpsudo ufw allow from 198.51.100.0/24 to any port 22 proto tcp comment 'office ssh'sudo ufw reject 23/tcpsudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.$(date +%F)sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_configsudo sed -i 's/^#PubkeyAuthentication.*/PubkeyAuthentication yes/' /etc/ssh/sshd_configsudo sed -i 's/^#PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_configsudo sshd -t -f /etc/ssh/sshd_configsudo sshd -T | grep -iE 'permitrootlogin|passwordauthentication|pubkeyauthentication'sudo systemctl restart sshsudo systemctl status ssh --no-pagersudo systemctl is-active sshsudo systemctl is-enabled sshssh -o PasswordAuthentication=no root@203.0.113.10ssh -p 22 -i ~/.ssh/id_ed25519 deploy@203.0.113.10ssh -o ServerAliveInterval=60 deploy@203.0.113.10ssh -A deploy@203.0.113.10ssh -J bastion.example.com deploy@203.0.113.10ssh -t deploy@203.0.113.10 sudo systemctl status nginxssh -G deploy@203.0.113.10ssh-keyscan -t ed25519 203.0.113.10 >> ~/.ssh/known_hostsscp -P 22 -i ~/.ssh/id_ed25519 deploy.tar.gz deploy@203.0.113.10:/home/deploy/sudo adduser --disabled-password --gecos '' deploysudo sed -i 's/^#AllowUsers.*/AllowUsers deploy/' /etc/ssh/sshd_configsudo sed -i 's/^#MaxAuthTries.*/MaxAuthTries 3/' /etc/ssh/sshd_configsudo sed -i 's/^#ClientAliveInterval.*/ClientAliveInterval 300/' /etc/ssh/sshd_configssh -o ExitOnForwardFailure=yes -L 3000:localhost:3000 deploy@203.0.113.10ssh-add -Lnano ~/.ssh/configsudo fail2ban-client restartsudo fail2ban-client set sshd maxretry 5sudo fail2ban-client set sshd findtime 600sudo fail2ban-client set sshd addignoreip 192.0.2.10sudo fail2ban-client set sshd delignoreip 192.0.2.10sudo fail2ban-client get sshd maxretrysudo 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.5sudo fail2ban-client set sshd unbanip 203.0.113.5sudo fail2ban-client status sshd shortsudo fail2ban-client statssudo tail -f /var/log/fail2ban.logsudo grep -E '^(bantime|findtime|maxretry)' /etc/fail2ban/jail.localsudo systemctl enable --now fail2bansudo systemctl reload fail2bansudo unattended-upgradesudo unattended-upgrade --dry-runsudo unattended-upgrade -dsudo grep -n 'Automatic-Reboot' /etc/apt/apt.conf.d/50unattended-upgradessudo nano /etc/apt/apt.conf.d/50unattended-upgradessudo tail -n 30 /var/log/unattended-upgrades/unattended-upgrades.logsudo systemctl status unattended-upgradessudo systemctl restart unattended-upgradessudo systemctl status apt-daily-upgrade.timersudo systemctl mask apt-daily-upgrade.timersudo systemctl unmask apt-daily-upgrade.timersudo apt list --upgradable | grep -v '^Listing'sudo apt-get -s upgrade | grep -c '^Inst'sudo do-release-upgradesudo apt-get dist-upgradesudo shutdown -r nowsudo apt install -y apt-listchangessudo fallocate -l 2G /swapfilesudo chmod 600 /swapfilesudo mkswap /swapfilesudo swapon /swapfilesudo swapoff /swapfileecho 'vm.swappiness=10' | sudo tee -a /etc/sysctl.confsudo sysctl -w vm.swappiness=10sudo sysctl --systemgit clone https://github.com/example/myapp.git /opt/myappsudo mkdir -p /opt/myapp && sudo chown deploy:deploy /opt/myappcd /opt/myapp && sudo npm ci --omit=devsudo -u deploy bash -lc 'cd /opt/myapp && npm ci --omit=dev && npm run build'sudo systemctl enable --now myapp.servicesudo systemctl restart myappsudo systemctl status myapp --no-pager -lsudo systemctl reset-failed myappsudo systemctl cat myappsudo systemctl show myapp -p MainPIDjournalctl -u myapp -fjournalctl -u myapp -n 100 --no-pagersudo journalctl -u myapp --since today -p warningsudo nginx -t && sudo systemctl reload nginxsudo apt install -y nginxcd /opt/myapp && git pull --ff-only origin main && sudo systemctl restart myappsudo -u deploy git -C /opt/myapp pull origin maingit -C /opt/myapp rev-parse --short HEADgit -C /opt/myapp log --oneline -5ssh 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_OKsudo mkdir -p /var/www/example.com/htmlsudo chown -R www-data:www-data /var/www/example.comcurl -I https://example.com | grep -iE '^HTTP'sudo nginx -T | grep -E 'server_name|listen'sudo systemctl daemon-reload && sudo systemctl restart myappsudo certbot renew --cert-name example.comsudo 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.comsudo certbot certificates | grep -E 'Certificate Name|Expiry Date'sudo certbot reconfigure --cert-name example.comsudo crontab -esudo crontab -lcrontab -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/fail2bansudo journalctl -b -1 -p errsudo journalctl -u ssh -b | grep -i 'failed password'sudo grep 'Accepted publickey' /var/log/auth.log | tail -10last -x shutdown rebootsudo ss -tlnp | grep :22sudo apt-get autoremove --purge -ysudo du -sh /var/log/* | sort -rh | head -10sudo lsof -iTCP -sTCP:LISTEN -P -nsudo visudo -f /etc/sudoers.d/deploy
Search all 7,657 commands instead.