命令记录学习

本文详细介绍了如何在Linux系统中管理用户(如添加、状态查看和禁用),设置密码策略,操作防火墙(包括关闭与启动),安装和管理Apache服务,以及配置SELinux和IP追踪。
摘要由CSDN通过智能技术生成

1.
查看当前用户
    cat /etc/passwd
添加test用户
    useradd test -G root
查看test用户状态
    id test
查看用户adaminstrator
    passwd -S adaminstrator
禁用用户adaminstrator
    passwd -l adaminstrator
密码策略设置文件地址
    vi /etc/pam.d/system-auth
设置密码命令 16行
    minlen=8 lcredit=-1 ucredit=-1 dcredit=-1 enforce_for_root
设置登录设置
    vi /etc/pam.d/login
在第二行插入
    auth required pam_tally2.so deny=3 unlock_time=600 even_deny_root root_unlock_time=600
设置远程登录设置
    vi /etc/pam.d/sshd
在第二行插入
    auth required pam_tally2.so deny=3 unlock_time=600 even_deny_root root_unlock_time=600


2.
查看防火墙服务
    systemctl status firewalld
关闭防火墙
    systemctl stop firewalld
查看apache服务
    systemctl status httpd
启动apache服务
    systemctl start httpd
安装apache服务
    yum install -y httpd
切换去指定路径
    cd /var/www/html/
创建文件和指定内容
    echo 'index.html' > index.html
查看本地ip地址
    ifconfig 
访问地址
    curl http://192.168.0.0/index.html
查看selinux功能
    getenforce 
开启selinux
    setenforce 1
设置index2不可访问
    chcon -t var_t /var/www/html/index2.html
查看访问类型
    ls -Z

3.根据ip筛选 追踪流

  • 8
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值