When logging on to servers I would like to have time displayed on my bash prompt so when I check previous things I've done, I can see at what time I did it. I think it's a particular useful feature when trying to debug things.
It can look like this:
[root@server 11:46:02 ~]# ls file1 file2 [root@server 11:47:50 ~]# whoami root
I found that I kind of can do this with
ssh root@server -t "export PS1='[\u@\h $(date +%H:%M:%S) \W]\$ '; exec bash"
ssh root@server -t "export PS1='[\u@\h \t \W]\$ '; exec bash"
But obviously the date won't be updated each time I type something new.
I haven't figured how to do it from PuTTY at all - I see there is a setting in Connections -> Data to send Environment variables to the server, but that doesn't work.
Note that I do not want to change anything on the server side (no sshd change, no bashrc or profile change) :)