zoukankan      html  css  js  c++  java
  • 架构师的成长之路初片~linux-基本防护措施

    1:修改用户账号的属性,设置某某时间实效(禁止登陆)

    2:临时锁定用户lisi的账户,使其无法登陆,验证效果后解除锁定

    3:修改tty终端提示,使得登陆前看到的第一行文本为“Windows Server 2012 Enterprise R2”,第二行文本为“NT 6.2 Hybrid”

    4:锁定文件/etc/resolv.conf  /etc/hosts,以防止其内容被无意中修改

    5:关闭不需要的服务

    [root@proxy ~]# rm -rf /etc/resolv.conf
    rm: 无法删除"/etc/resolv.conf": 不允许的操作
    [root@proxy ~]# echo xyz > /etc/resolv.conf
    -bash: resolv.conf: 权限不够

    1. [root@proxy ~]# rm -rf /etc/hosts                      #失败
    2. [root@proxy ~]# echo "192.168.4.1 xyz" > /etc/hosts   #失败
    3. [root@proxy ~]# echo "192.168.4.1 xyz" >> /etc/hosts #成功

    恢复这两个文件原有的属性

    [root@proxy ~]# chattr -i /etc/resolv.conf 
    [root@proxy ~]# chattr -i /etc/hosts
    [root@proxy ~]# lsattr /etc/resolv.conf /etc/hosts
    --------------- /etc/resolv.conf
    --------------- /etc/hosts

  • 相关阅读:
    HTML/CSS
    Python字符编码
    软件测试遇到的问题积累
    数学
    经济学路谱
    工具
    DataStage
    Shell编程—定时任务
    WebLogic部署
    imageView-scaleType 图片压缩属性
  • 原文地址:https://www.cnblogs.com/ahaocloud/p/14823962.html
Copyright © 2011-2022 走看看