随笔分类 -  Linux基础

摘要:1.编辑/etc/bashrc if unset PROMPT_COMMAND > /dev/null 2>&1 then declare -r REAL_USER=$(who am i|awk '{print $1}') declare -r LOGINTIME=$(date "+%s") dec 阅读全文
posted @ 2021-10-11 13:28 等等马上就好 阅读(161) 评论(0) 推荐(0)
摘要:1.创建访问策略组 2.添加条目(需要对那些IP开放) 3.找出域名对应的公网ip 4.进行管理 5.进行配置 阅读全文
posted @ 2021-08-16 16:58 等等马上就好 阅读(463) 评论(0) 推荐(0)
摘要:为了增强Linux系统的安全性,我们需要在用户输入空闲一段时间后自动断开,这个操作可以由设置TMOUT值来实现。将以下字段加入到/etc/profile 中即可(对所有用户生效)。 0 ✓ 10:10:47 root@master01,192.168.0.120:~ # cat /etc/profi 阅读全文
posted @ 2021-07-20 10:12 等等马上就好 阅读(488) 评论(0) 推荐(0)
摘要:[root@master01 ~]# cat /etc/motd ********************************************* _ooOoo_ o8888888o 88" . "88 (| -_- |) O\ = /O ____/` '\____ .' \\| |// 阅读全文
posted @ 2021-07-19 10:06 等等马上就好 阅读(254) 评论(0) 推荐(0)
摘要:1.查看 [root@centos7 network-scripts]# systemctl status network ● network.service - LSB: Bring up/down networking Loaded: loaded (/etc/rc.d/init.d/netwo 阅读全文
posted @ 2021-02-24 18:03 等等马上就好 阅读(339) 评论(0) 推荐(0)
摘要:1.编辑 [root@db03 ~]# vim /etc/profile.d/ps1.sh _set_prompt () { #see: http://misc.flogisoft.com/bash/tip_colors_and_formatting #Reset \e[0m ## Formatti 阅读全文
posted @ 2020-08-06 20:53 等等马上就好 阅读(131) 评论(0) 推荐(0)
摘要:sudo 身份提权(更安全) su 命令在切换用户身份时,如果每个普通用户都能拿到root用户的密码,当其中某个用户不小心泄漏了root的密码,那系统会变得非常不安全。 为了改进这个问题,从而产生了sudo这个命令。 sudo 执行一个仅有root身份才能执行的命令是可以办到的,但是需要输入密码,这 阅读全文
posted @ 2020-07-13 21:00 等等马上就好 阅读(157) 评论(0) 推荐(0)