随笔分类 -  centos

摘要:在/etc/hosts.allow输入(其中192.168.10.88是你要允许登陆ssh的ip,或者是一个网段192.168.10.0/24) sshd:192.168.10.88:allow 在/etc/hosts.deny输入(表示除了上面允许的,其他的ip 都拒绝登陆ssh) sshd:AL 阅读全文
posted @ 2022-02-23 16:01 赵瑛 阅读(311) 评论(0) 推荐(0) 编辑
摘要:1、修改配置 vi /etc/ssh/sshd_config 2、在配置中找到 #ClientAliveInterval 0 #ClientAliveCountMax 3 3、修改为 ClientAliveInterval 30 ClientAliveCountMax 3 ClientAliveIn 阅读全文
posted @ 2022-02-23 15:24 赵瑛 阅读(644) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash ftp -n<<! open 192.168.1.2 #ftp上传地址 user ftp_username ftp_userpass #ftp帐号和密码 binary hash cd / #ftp服务端存储目录 lcd /home/backup/database #ftp客户 阅读全文
posted @ 2022-01-18 10:48 赵瑛 阅读(166) 评论(0) 推荐(0) 编辑
摘要:find /目录 -name "*.php" | xargs rm -f 阅读全文
posted @ 2021-11-19 17:13 赵瑛 阅读(204) 评论(0) 推荐(0) 编辑
摘要:find / -size +100M -exec ls -lh {} \; # 查看整体磁盘占用df -h#切换到这块磁盘检查一下这块磁盘的哪个文件夹占用高,再逐层去查找 du -h --max-depth=1 [root@localhost logs]# du -h --max-depth=1 | 阅读全文
posted @ 2021-11-03 22:02 赵瑛 阅读(1112) 评论(0) 推荐(0) 编辑
摘要:1、查看当前未挂载的硬盘 # fdisk -l 2、创建硬盘分区 # fdisk /dev/sdb 根据提示,依次输入"n","p" "1",两次回车,"wq",分区就开始了,很快就会完成。 3、格式化硬盘 # mkfs.ext4 /dev/sdb 4、建立挂载目录 # mkdir /data 5、 阅读全文
posted @ 2021-10-27 17:15 赵瑛 阅读(4511) 评论(1) 推荐(0) 编辑
摘要:1、开放端口 firewall-cmd --zone=public --add-port=5672/tcp --permanent # 开放5672端口 firewall-cmd --zone=public --remove-port=5672/tcp --permanent #关闭5672端口 f 阅读全文
posted @ 2021-08-24 15:22 赵瑛 阅读(2521) 评论(0) 推荐(0) 编辑
摘要:安装firewall后(LINUX7系统一般情况下默认已安装),防火墙默认配置是只打开SSH端口的,也就是22端口,如果SSH的端口已更改成别的端口了,请切记一定在启动firewall前先修改对应服务策略中SSH的端口为你的SSH端口,文件路径:/usr/lib/firewalld/services 阅读全文
posted @ 2021-08-12 10:18 赵瑛 阅读(1165) 评论(0) 推荐(0) 编辑
摘要:先进入mysql1、mysql -u root -p2、输入密码3、use 要导入的数据库名(没有就新建一个,使用create database test;命令新建,再use test;,再set names utf8;设置一下编码)4、source /home/test.sql; (选择要导入的数 阅读全文
posted @ 2021-08-10 15:18 赵瑛 阅读(359) 评论(0) 推荐(0) 编辑
摘要:查看已开放的端口 firewall-cmd --list-ports 开放端口(开放后需要要重启防火墙才生效) firewall-cmd --zone=public --add-port=3338/tcp --permanent 关闭端口(关闭后需要要重启防火墙才生效) firewall-cmd - 阅读全文
posted @ 2021-08-10 14:58 赵瑛 阅读(671) 评论(0) 推荐(0) 编辑
摘要:1、mkdir /home/mysql;2、1、查找版本rpm -qa|grep mariadb3、删除rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_644、删除配置文件rm /etc/my.cnf5、groupadd mysql6、useradd 阅读全文
posted @ 2021-08-06 14:59 赵瑛 阅读(100) 评论(0) 推荐(0) 编辑
摘要:从CentOS 7开始,使用了一个新的命令timedatectltimedatectl 命令(1) 读取时间timedatectl //等同于 timedatectl status(2) 设置时间timedatectl set-time “YYYY-MM-DD HH:MM:SS”(3) 列出所有时区 阅读全文
posted @ 2021-08-06 14:56 赵瑛 阅读(673) 评论(0) 推荐(0) 编辑
摘要:OpenSSH是SSH协议的免费开源实现,经常会曝出安全漏洞,由于CentOS7自带的OpenSSH版本(OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017)太低,有必要进行新服务器的OpenSSH版本升级。升级OpenSSH升级前首先需要升级OpenSSL 阅读全文
posted @ 2021-08-06 14:17 赵瑛 阅读(1767) 评论(0) 推荐(0) 编辑

版权所有 © 2022 沅来是澧

如果有程序开发、网站建设等需求的请联系我,QQ:47419233

点击右上角即可分享
微信分享提示