Bash – How to display ssh commands executed from another machine

bashnetworkingshellssh

Can I see what other users type/execute via SSH in my server via bash or shell?

Best Answer

Read the user history file from their home directory.

less .bash_history

And if needed then with timestamps too on history command.

echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bashrc

source ~/.bashrc
Related Question