shell
killer_999
这个作者很懒,什么都没留下…
展开
-
centos6/7自动修改sshd端口
源代码来自于博客https://blog.csdn.net/matchbox1234/article/details/110930656 修改获取进程部分,增加防火墙开放端口,增加注释原来端口。 #!/bin/bash #说明:SSHD服务默认监听端口是22,如果你不强制说明别的端口,”Port 22”注不注释都是开放22访问端口 portset=$1 if [ ! -z "$portset" ];then inputportlen=`echo "$portset"|sed 's/[0-9]//g'`转载 2021-06-04 11:25:40 · 171 阅读 · 0 评论 -
Centos7安装openssh8.2
升级前信息: openssl version ssh -V cat /etc/redhat-release 1.安装telnet-server以及xinetd yum install xinetd telnet-server -y cat >>/etc/securetty << \EOF pts/0 pts/1 pts/2 pts/3 EOF tail -5 /etc/se...原创 2020-04-02 13:51:16 · 3429 阅读 · 2 评论 -
运维常见脚本-centos7
1.配置操作历史写入系统日志并且history命令显示ip用户名 #!/bin/bash cat >> /etc/profile << \EOF USER_IP=$(who i am 2>/dev/null|awk '{print $NF}'|sed -e 's/[()]//g') if [ ! $USER_IP ]; then USER_IP=$(hostname...原创 2020-01-10 09:54:35 · 553 阅读 · 0 评论 -
linux shell脚本批量添加用户
有事有需求要批量添加用户所以写了个脚本 从user.list中读取数据每一行就是一个用户名 #!/bin/bash for username in $(more user.list) do if [ -n $username ] then echo $username useradd -m $username echo echo $username"!@#" | passwd --stdi...原创 2019-02-20 12:26:27 · 3049 阅读 · 0 评论