SSH FingerprintLogging
From Lolly's Wiki
SSH Fingerprintlogging
Why logging fingerprints?
It is just for the possibility of setting the Bash HISTFILE per logged in user.
Add magic to your .bashrc
- ~/.bashrc
...
FINGERPRINT=$(ssh_client_array=( ${SSH_CLIENT} ); journalctl --lines=100 --grep "${ssh_client_array[0]} port ${ssh_client_array[1]}" --no-pager --quiet --unit=ssh.service | awk 'END{print $NF}')
export HISTFILE=~/.bash_history_${FINGERPRINT:-${SUDO_USER:-default}}
...