CentOS

2024/3/11 CentOS

# 防火墙

  • 查看防火墙的状态。
systemctl status firewalld
1
  • 查看防火墙开放的端口列表。
firewall-cmd --list-port
1
  • 开启防火墙。
systemctl start firewalld
1
  • 关闭防火墙。
systemctl stop firewalld
1
  • 开放端口。
firewall-cmd --zone=public --add-port=3306/tcp --permanent
1
  • 关闭端口。
firewall-cmd --permanent --remove-port=3306/tcp
1
  • 重启防火墙(更新配置)。
firewall-cmd --reload
1

# 显存

  • 查看显存信息
watch -n 1 nvidia-smi
1

# 问题汇总

  1. ssh 连接远程服务器时报错 Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
vim /etc/ssh/sshd_config
# 将配置文件中 PasswordAuthentication 的值改为 yes
PasswordAuthentication yes
1
2
3
  1. 关闭CentOS系统提示音。
vim /etc/inputrc
# 修改配置文件以下内容。bell-style 的取值范围是:none, visible, audible
set bell-style none
# 重新启动服务器
reboot
1
2
3
4
5
  1. 关闭 vim编辑器提示音。
vim /etc/vimrc
# 添加以下配置
set vb t_vb=
1
2
3
  1. 重启网络后,IP 转发被禁用。
vi /etc/sysctl.conf
# 添加如下代码
net.ipv4.ip_forward=1
# 重启 network 服务
systemctl restart network
1
2
3
4
5
更新时间: 2024/3/11 上午1:57:53