Cneots 配置

A little Mew
2021-09-21 12:41
39
0
  1. 下载地址 http://mirrors.163.com/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso

  2. USB 启动、安装

## 启动项按E 找到编辑内容,查找USB路径:
vmlinuz initrd=initrd.img linux dd quiet
## 查看确定USB盘符后修改为 :
vmlinuz initrd=initrd.img inst.stage2=hd:/dev/sdb4 quiet
  1. Eprl 安装
## 查询是否已经安装epel库
rpm -qa|grep epel
yum install -y epel-release
  1. 开启sudo,·vim /etc/sudoers
root        ALL=(ALL)       ALL
## add
username    ALL=(ALL)       ALL
  1. 安装常用软件
## 先卸掉防火墙
systemctl stop firewalld
systemctl disable firewalld
yum remove firewalld

## 安装常用的
yum install vim 
yum install wget
yum install zip 
yum install unzip 
yum install screen
yum install ntp
yum install iptables-services

## 全部的自启动
systemctl start tomcat nginx mariadb crond ntpd iptables
systemctl enable tomcat nginx mariadb crond ntpd iptables
  1. 配置 iptables:
## 先卸载 firewalld
systemctl stop firewalld
yum remove firewalld
## 安装iptables
yum install iptables-services
## 安装出错的话可以卸载再来一次
yum remove iptables-services
yum install iptables-services
## 编辑配置
sudo vim /etc/sysconfig/iptables
## 添加
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22    -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80    -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443   -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306  -j ACCEPT
## 重启iptables
systemctl restart iptables
  1. 配置静态 IP 地址 vim /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO="static"
IPADDR=192.168.1.3
IPADDR2=192.168.31.3
GATEWAY=192.168.1.1
DNS1=114.114.114.114
DNS2=192.168.1.1
  1. 配置 HomekitBridge
npm install -g homebridge-mi-outlet
npm install -g homebridge-camera-ffmpeg
npm install -g homebridge-synology
  1. 文件查找
find ./ -name ".DS_Store"
find ./ -name "@eaDir" | xargs -I {} rm -fr "{}"
find ./ -name ".DS_Store" | xargs -I {} rm -f "{}"
ls -lR | grep "^-"| wc -l
  1. ssh 保持连接

vim /etc/ssh/ssh_config

## 16秒服务端就向客户端发送一个数据包来保持连接,128次无响应就断开连接
ClientAliveInterval 16
ClientAliveCountMax 128

## ServerAliveInterval 16
## ServerAliveCountMax 128:
  1. 文件挂载 vim /etc/rc.d/rc.local
mount -t cifs -o username=usn,password=pwd //192.168.1.2/share/  /share/

全部评论