CentOS技巧合集

创建时间:2024-07-09T02:27:51Z评论数:6
CentOS技巧合集

centos Linux有关的内容放到这里

mirrows
2024-07-09T02:33:47Z

保持ssh客户端不断线

修改ssh配置文件/etc/ssh/sshd_config,添加或者修改ClientAliveInterval为“ClientAliveInterval 60”。这个参数的是意思是每1分钟,服务器向客户端发一个消息,用于保持连接。保存后记得重启ssh服务。

修改过后,上面几个办法都可以让ssh保持连接,一直处于alive状态,不会因为没有操作而被服务器强制断线了。

mirrows
2024-07-09T02:52:13Z

修改密码: passwd [用户名]

mirrows
2024-07-09T03:05:48Z

CentOS报错:yum被占用 Another app is currently holding the yum lock; waiting for it to exit...

// 直接干掉
rm -f /var/run/yum.pid
// 查看进程
ps aux|grep yum
mirrows
2024-07-09T05:49:25Z

method xchacha-ietf-poly1305 not supported 解决方案

yum -y groupinstall "Development Tools"
wget https://github.com/jedisct1/libsodium/releases/download/1.0.11/libsodium-1.0.11.tar.gz
tar xf libsodium-1.0.11.tar.gz && cd libsodium-1.0.11
./configure && make -j2 && make install
echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf
ldconfig
mirrows
2024-07-10T06:44:53Z

bash: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8)

localedef -i en_US -f UTF-8 en_US.UTF-8
mirrows
2024-07-10T09:18:11Z

解决nginx访问问题connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream

// 关闭selinux
[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
[root@localhost ~]# sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config

上面不行的话,执行下面的命令

setsebool -P httpd_can_network_connect 1