Linux常用操作

2025-01-08 / 0 评论 / 37 阅读 / 正在检测是否收录...

Linux常用操作

Linux常用操作主要包含Shell命令行等命令

fail2ban封禁和解封指定IP

#fail2ban把IP加入黑名单
fail2ban-client set sshd banip  1.1.1.1

#fail2ban把IP从黑名单移除
fail2ban-client set sshd unbanip  1.1.1.1 

返回1为成功,0即表示规则没有发生变化,即操作失败(说明IP本来就在列表或者不在列表中)

ulimit参数优化

ulimit -a
编辑 /etc/security/limits.conf

root soft    nofile  1024000
root hard    nofile  1024000
root soft    nproc   1024000
root hard    nproc   1024000
* soft    nofile  1024000
* hard    nofile  1024000
* soft    nproc   1024000
* hard    nproc   1024000
* soft core unlimited
* soft stack 10240

立即生效命令:
ulimit -uSH

Debian12安装常用软件

apt install locales-all -y

apt install rsyslog -y
systemctl start rsyslog
systemctl enable rsyslog
systemctl restart fail2ban.service
systemctl status fail2ban.service

apt update
apt install command-not-found sudo strace iftop iotop -y
apt install vim htop -y
apt install netcat-openbsd htop wget curl mtr nmap tcpdump bind9-utils lrzsz rsync git -y
apt install sysstatiftop iotop lsof strace -y
apt install unzip unrar-free dos2unix tree tmux screen -y
apt install nginx php php-fpm nodejs python3-pip redis-server -y
apt install composer docker-compose -y
apt install inotify-tools -y
apt install fail2ban -y
apt install php php-{fpm,mysql,curl,zip,xml,gd,mbstring,bcmath,soap,ldap,oauth,redis,yaml,gd,curl,pdo,dom,zip,xml} -y
apt install python3-certbot-nginx certbot -y

SSL证书常用操作

openssl x509 -in /etc/letsencrypt/live/gmork.cc/cert.pem -text
0

评论 (0)

取消