- 工信部备案号 滇ICP备05000110号-1
- 滇公安备案 滇53010302000111
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
1.查看日志文件
Linux查看/var/log/wtmp文件查看可疑IP登陆
last -f /var/log/wtmp
该日志文件永久记录每个用户登录、注销及系统的启动、停机的事件。因此随着系统正常运行时间的增加,该文件的大小也会越来越大,增加的速度取决于系统用户登录的次数。该日志文件可以用来查看用户的登录记录,last命令就通过访问这个文件获得这些信息,并以反序从后向前显示用户的登录记录,last也能根据用户、终端tty或时间显示相应的记录。
2.查看/var/log/secure文件寻找可疑IP登陆次数。
3.查看其他用户的操作命令
(1)通过在/etc/profile里面加入以下代码就可以实现:
#cheke history command start!
PS1="`whoami`@`hostname`:"[$PWD]
history
USER_IP=`who -u am i 2>/dev/null| awk {print $NF}|sed -e s/[()]//g`
if [ "$USER_IP" = "" ]
then
USER_IP=`hostname`
fi
if [ ! -d /tmp/historycommand ]
then
mkdir /tmp/historycommand
chmod 777 /tmp/historycommand
fi
if [ ! -d /tmp/historycommand/${LOGNAME} ]
then
mkdir /tmp/historycommand/${LOGNAME}
chmod 300 /tmp/historycommand/${LOGNAME}
fi
export HISTSIZE=4096
DT=`date "+%Y-%m-%d_%H:%M:%S"`
export HISTFILE="/tmp/historycommand/${LOGNAME}/${USER_IP} historycommand.$DT"
chmod 600 /tmp/historycommand/${LOGNAME}/*historycommand* 2>/dev/null
#the end
(2)source /etc/profile 使用脚本生效
(3)上面脚本在系统的/tmp新建个historycommand目录,记录所有登陆过系统的用户和IP地址(文件名),每当用户登录/退出会创建相应的文件,该文件保存这段用户登录时期内操作历史,可以用这个方法来监测系统的安全性。
售前咨询
售后咨询
备案咨询
二维码
TOP