随笔分类 - 1inux运维
摘要:echo 0>/root/.ssh/authorized_keys echo 0>/var/spool/mail/root echo 0>/var/log/wtmp echo 0>/var/log/secure echo 0>/var/log/cron echo 0>~/.bash_history
阅读全文
posted @ 2021-10-12 13:51
1769987233
摘要:#echo $LANG #localectl status # 显示当前的本地化设置与键盘映射 dnf install langpacks-zh_CN -y cat > /etc/locale.conf <<EOF LANG="zh_CN.UTF-8" EOF source /etc/locale.
阅读全文
posted @ 2021-10-12 12:04
1769987233
摘要:# 显示光标 echo -e "\033[?25h" # 隐藏光标 echo -e "\033[?25l"
阅读全文
posted @ 2021-10-12 11:58
1769987233
摘要:# 使用密钥登录 ssh-keygen -t rsa [root@host ~]$ ssh-keygen <== 建立密钥对 Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh
阅读全文
posted @ 2021-10-11 14:58
1769987233
摘要:Error: JAVA_HOME is not set. [root@ecs-5609 fe]# which java /usr/bin/java [root@ecs-5609 fe]# ll /usr/bin/java lrwxrwxrwx 1 root root 22 12月 21 2020 /
阅读全文
posted @ 2021-10-09 11:39
1769987233
摘要:名称 journald.conf, journald.conf.d — 日志服务配置文件 大纲 /etc/systemd/journald.conf /etc/systemd/journald.conf.d/*.conf /run/systemd/journald.conf.d/*.conf /us
阅读全文
posted @ 2021-09-26 17:03
1769987233
摘要:系统日志在疯狂刷ssh日志 背景: 华为云ecs(4.19.90-17.5.ky10.aarch64)发现系统日志在疯狂刷ssh日志 [root@ecs-5614 ~]# tail -f /var/log/messages Sep 26 16:18:51 ecs-5614 audit[251418]
阅读全文
posted @ 2021-09-26 17:02
1769987233
摘要:nginx警告: nginx: [warn] could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignorin
阅读全文
posted @ 2021-09-26 14:53
1769987233
摘要:centos8安装nignx最新版 创建官方repo源 [root@izgu3e8gvhx2vgz ~]# vim /etc/yum.repos.d/nginx.repo [nginx-stable] name=nginx stable repo baseurl=http://nginx.org/p
阅读全文
posted @ 2021-09-22 11:26
1769987233
摘要:1、在/etc/sudoers文件添加和root一样的命令行,当然是用root用户登录,如下: vi /etc/sudoers 或vim /etc/sudoers (vim标亮显示更易看) 找到 root ALL=(ALL) ALL 给lsh用户增加sudo权限 lsh ALL=(ALL) ALL
阅读全文
posted @ 2021-09-21 21:53
1769987233
摘要:su和su - 联系:都是切换到root 区别:前者只是切换了root身份,但 Shell环境仍然是普通用户的 Shell;而后者连用户和Shell环境一起切换成root身份了。只有切换了Shell环境才不会出现PATH环境变量错误。su切换成root用户以后,pwd一下,发现工作目录仍然是普通用户
阅读全文
posted @ 2021-09-21 21:48
1769987233
摘要:使用safe-rm替换rm命令,防止误删除 wget https://launchpad.net/safe-rm/trunk/0.12/+download/safe-rm-0.12.tar.gz tar -zxf safe-rm-0.12.tar.gz cp safe-rm-0.12/safe-rm
阅读全文
posted @ 2021-09-21 21:07
1769987233
摘要:安装密码生成工具 $ yum -y install httpd-tools 生成用户和密码文件 生成用户和密码 $ htpasswd -c /usr/local/nginx/password username # 回车后输入密码 # -c 创建一个加密文件 删除用户和密码 $ htpasswd -D
阅读全文
posted @ 2021-09-21 16:11
1769987233
摘要:root@yang:~ # curl cip.cc IP : 47.113.205.x 地址 : 中国 中国 数据二 : 广东省深圳市 | 阿里云 数据三 : 中国广东深圳 | 阿里云 URL : http://www.cip.cc/47.113.205.x
阅读全文
posted @ 2021-09-20 23:03
1769987233
摘要:传统的共享内存是System V形式的,可通过"/proc/sys/kernel/shmall"参数限制其占用的最大物理内存空间,像这样: echo 1024 > /proc/sys/kernel/shmall # 1个G echo 1048576 > /proc/sys/kernel/shmall
阅读全文
posted @ 2021-09-18 16:27
1769987233
摘要:[root@ecs-5611 ~]# cat /etc/hosts | nl 1 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 2 127.0.0.1 localhost localhost.locald
阅读全文
posted @ 2021-09-17 23:22
1769987233
摘要:线上服务器shared占用很大 [root@ecs-5611 ~]# free -h total used free shared buff/cache available Mem: 15Gi 10Gi 1.3Gi 3.4Gi 4.0Gi 510Mi Swap: 0B 0B 0B [root@ecs
阅读全文
posted @ 2021-09-17 11:43
1769987233
摘要:安装zsh yum install zsh # CentOS chsh -s /bin/zsh 可以通过echo $SHELL查看当前默认的shell,如果没有改为/bin/zsh,那么需要重启shell。 安装oh-my-zsh 有若干安装方式,介绍三种: 1.自动安装 wget https://
阅读全文
posted @ 2021-09-16 16:50
1769987233
摘要:通过python(python3 -m http.server 8000)等启服务,可以telnet,原容器的端口在监听但是不能telnet,可以尝试重启容器
阅读全文
posted @ 2021-09-16 11:14
1769987233
摘要:使用Python启动一个简单的服务器 Python2 1、当前目录发布到8001端口(明令后边的8001端口是可选的,不设置的话使用默认端口8000),该服务是前台运行的,control+c会关闭该服务。 python -m SimpleHTTPServer 8001 2、进程在后台运行,contr
阅读全文
posted @ 2021-09-16 10:56
1769987233

浙公网安备 33010602011771号