Simple tool to clean SSH logs and user traces when users disconnect from the server.
- Monitors active SSH sessions
- Automatically cleans logs when users disconnect
- Removes authentication logs, command history, and system logs
- Can clean logs for specific users manually
- Linux server with root access
- Rust compiler installed
- Clone repo
- Run the build script:
chmod +x build.sh
./build.shThis creates a static binary ssh_log_cleaner in the current directory.
sudo ./ssh_log_cleaner monitorsudo ./ssh_log_cleaner clean username
sudo ./ssh_log_cleaner clean username 192.168.1.100/var/log/auth.log- SSH authentication logs~/.bash_history,~/.zsh_history- Command history/var/log/syslog,/var/log/messages- System logs/var/log/wtmp- Session logs
sudo cp ssh_log_cleaner /usr/local/bin/This tool removes system logs. Use responsibly and ensure compliance with your security policies.