Skip to content

Intrusion trace cleaning for Linux

clean command history

histroy -r          #删除当前会话历史记录
history -c          #删除内存中的所有命令历史
rm .bash_history    #删除历史文件中的内容
HISTSIZE=0          #通过设置历史命令条数来清除所有历史记录

use vim with the following commands

:set history=0
:!command

clean log

/var/run/utmp     记录现在登入的用户
/var/log/wtmp     记录用户所有的登入和登出
/var/log/lastlog  记录每一个用户最后登入时间
/var/log/btmp     记录错误的登入尝试
/var/log/auth.log 需要身份确认的操作
/var/log/secure   记录安全相关的日志信息
/var/log/maillog  记录邮件相关的日志信息
/var/log/message  记录系统启动后的信息和错误日志
/var/log/cron     记录定时任务相关的日志信息
/var/log/spooler  记录UUCP和news设备相关的日志信息
/var/log/boot.log 记录守护进程启动和停止相关的日志消息

Hide SSH login record

ssh -o UserKnownHostsFile=/dev/null -T [email protected] /bin/bash –i

Disclaimer
  1. License under CC BY-NC 4.0
  2. Copyright issue feedback me#imzye.me, replace # with @
  3. Not all the commands and scripts are tested in production environment, use at your own risk
  4. No privacy information is collected here
Try iOS App