Сертификаты и шифрование, права доступа, учётные записи, firewall, разбор и трассировка процессов.
openssl genpkey -algorithm rsa -out key.pem -aes256openssl rsa -in key.pem -pubout -out pub.pemopenssl req -new -x509 -key key.pem -out cert.crt -days 365openssl x509 -in cert.crt -text -nooutopenssl req -new -key key.pem -out req.csropenssl x509 -in cert.crt -out cert.pem -outform pemopenssl versiongpg --full-generate-keygpg -kgpg --clearsign doc.txtgpg -es -r alice@example.com doc.txtgpg -c doc.txtgpg -d doc.txt.gpggpg --export -a alice@example.comage -p -o file.age fileage -r pubkey -o file.age fileage -d -i key.txt -o file file.agechmod u+x filechmod g-x filechmod o= filechmod -R a+rX dirsudo chattr +i filesudo chattr +a filelsattr filesetfacl -m u:bob:rw filesetfacl -x u:bob filegetfacl fileumaskumask 077chage -l usernamesudo chage -M 10 usernamesudo chage -M -1 usernamesudo chage -E YYYY-MM-DD usernamesudo chage -d 0 usernamepasswd -Ssudo passwd -d usernamesudo iptables -vnL --line-numberssudo iptables -A chain -s ip -p tcp --dport port -j rulesudo iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADEsudo iptables -D chain rule_numbersudo nft list rulesetsudo nft add table inet filtersudo nft add rule inet filter input tcp dport { ssh, http, https } acceptsudo nft delete rule inet filter input handle 3sudo ufw enablesudo ufw status numberedsudo ufw allow 5432 comment "service"sudo ufw allow proto tcp from 192.168.0.4 to any port 22sudo ufw delete rule_numberopenssl s_client -connect host:443openssl s_client -connect host:443 -showcertsopenssl s_client -connect host:443 -servername hostecho | openssl s_client -connect host:443 2>/dev/null | openssl x509 -noout -datesopenssl s_client -connect host:443 -tls1_2openssl s_client -connect host:25 -starttls smtpssh-keygen -t ed25519 -C "comment"ssh-copy-id -i key.pub user@hostssh-keygen -p -f keyssh-keygen -lf key.pubPasswordAuthentication noPermitRootLogin noPort 2222sudo sshd -tsudo visudosudo -l%wheel ALL=(ALL) NOPASSWD: ALLsudo -u username commandsudo -kuser ALL=(root) NOPASSWD: /usr/bin/systemctl restart nginxsudo fail2ban-client statussudo fail2ban-client status sshdsudo fail2ban-client set sshd unbanip ipsudo fail2ban-client set sshd banip ipsudo fail2ban-client reloadsudo iptables -L f2b-sshd -nsudo auditctl -w /etc/passwd -p wa -k passwd_changessudo auditctl -lsudo ausearch -k passwd_changessudo ausearch -ua usernamesudo aureport -kgetcap /usr/bin/binarysudo setcap cap_net_bind_service=+ep /usr/bin/binarysudo setcap -r /usr/bin/binarygetpcaps pidsudo strace -p pidsudo strace -p pid -e network,filesudo strace -p pid -cstrace -f -e trace=network -o trace.txt programltrace path/to/programltrace -c path/to/programgdb -p pidgdb -c core executablelsof -i :443lsof -u usernamefuser path/to/filefuser -k 8080/tcp