image.png
last等日志是二进制文件,无法直接修改。所以清除的最简单方式是清空日志文件本身。
# echo > /var/log/wtmp
# echo > /var/log/btmp
# echo > /var/log/lastlog
参考 https://www.shellhacks.com/clear-remove-last-login-history-linux/ https://www.cyberciti.biz/faq/howto-display-clear-last-login-information/ Linux下快速清空文件的方法https://blog.csdn.net/counsellor/article/details/87084598