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

  • 相关阅读:
    HDU 2073 无限的路
    HDU 2080 夹角有多大II
    if
    HDU 2094 产生冠军
    HDU 2076 夹角有多大(题目已修改,注意读题)
    HDU 2086 A1 = ?
    HDU 2069 Coin Change
    HDU 2095 find your present (2)
    android常用开发工具的用法
    android安装前期遇到的问题
  • 原文地址:https://www.cnblogs.com/ahaocloud/p/14823962.html
Copyright © 2011-2022 走看看