CentOS
2024年3月11日小于 1 分钟
防火墙
- 查看防火墙的状态。
systemctl status firewalld- 查看防火墙开放的端口列表。
firewall-cmd --list-port- 开启防火墙。
systemctl start firewalld- 关闭防火墙。
systemctl stop firewalld- 开放端口。
firewall-cmd --zone=public --add-port=3306/tcp --permanent- 关闭端口。
firewall-cmd --permanent --remove-port=3306/tcp- 重启防火墙(更新配置)。
firewall-cmd --reload显存
- 查看显存信息
watch -n 1 nvidia-smi问题汇总
ssh连接远程服务器时报错Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
vim /etc/ssh/sshd_config
# 将配置文件中 PasswordAuthentication 的值改为 yes
PasswordAuthentication yes- 关闭
CentOS系统提示音。
vim /etc/inputrc
# 修改配置文件以下内容。bell-style 的取值范围是:none, visible, audible
set bell-style none
# 重新启动服务器
reboot- 关闭
vim编辑器提示音。
vim /etc/vimrc
# 添加以下配置
set vb t_vb=- 重启网络后,IP 转发被禁用。
vi /etc/sysctl.conf
# 添加如下代码
net.ipv4.ip_forward=1
# 重启 network 服务
systemctl restart network