I am using putty for telnet and SSH connections to ESXi hosts, switches and/or filers. Putty is a simple but great tool for this purpose!
Putty has the option to log telnet and SSH traffic session output to disk. I think it’s a good idea to always log the telnet and SSH session output of every session to a file. In this way you always have a great reference/history available, which contains all previous commands and output of earlier telnet and SSH sessions.
Configure Putty
When you want putty to log all your session output, you have to change the default settings. This is pretty simple: open putty and go to Session->Logging. Select all session output and specify a log file.
I am using some putty parameters which will make every session unique, in this case “&H-&Y&M&D-&T.log”, which means:
- &H = hostname for the session
- &Y = year
- &M = month
- &D = day
- &T = time
The next step is save this new log settings to the Default Settings profile in putty; the Default Settings profile contains your….uh…Default Settings :). Every new putty session
will now log its output to a (new) logfile. Already saved sessions will not be affected by this setting, you have to change these sessions separately.
You will now end up with a bunch of unique log files for the various putty sessions and you’re building your own great putty-reference-database in the log directory specified.
28 Comments
Mvd
Nice job!
It`s in production! 🙂
Ramakrishna
Thanks this helped me a lot
qaw
Thank you!
Terence
Wondeful.. Thanks
Anirudh Gunda
Thanks for helping me!!! Showed exactly what I am looking for 🙂
khai
anyone know what is the command line to save session for putty? thanks..
Pingback: Putty automation using excel vba
Nishant
Reposting (I think HTML characters are forbidden)
Another tip, sharing for everyone’s benefit. How to Combine this feature with Putty Windows CLI feature:
1. Go to Windows > Run > cmd
2. Set path for putty command
set path=C:\Program Files (x86)\PuTTY
3. Now run putty using this command:
putty -l username -pw password hostname.companyname.com
4. Voila, thanks to Viktor’s tip, each session will now be logged with a unique filename.
Thus you just need to change the hostnames each time, and you can get a seamless experience while doing bulk putty tasks.
Mike
Is it possible to change it from the host name to the session Name i have different hosts that i connect to and it would be nice to tell which one i am looking at by the Saved session name
Example
Host = admin@10.6.X.X
Saved session = ARP entry
Sandeep
V Good procedure
superputtyuser
Good stuff…works nicely. Thanks.
piyush
Thanks for putty trick
Nadeem
Very useful information. Thanks a lot for sharing it
kostas
Thanks a Lot!!! very nice tip!
ponrajkumar
Thanks Mr. Viks !!! its helped me lot..
Pingback: Linux tips – Learn and solutions
Alex
I am using Putty Command manager and has created a database for quite few sessions. When I try to enable logging , the settings never stays on. it defaults back to no logging
Creggerj
here’s something that you can try.
go into registry and look at the following.
REG
HKCU\software\SimonTathatm\PuTTY\Sessions\
in here are the profiles stored.
you can easily create a profile called test and modify it to your liking.
once you make it, go to this location in registry. delete the default profile called “Default%20Settings” and rename your test profile to “Default%20Settings” tis way if you export the newly modified profile.. you can basically take your settings with you.
muktaf
I want to know checking the result of my computation using Putty. Because when I use bjobs the result is negative impact . How to check and find out the problem?
Velusamy Subbarayalu
Thank you so much. You Just Made My Day!
Alex
Thank you for useful info!
Moises Simon Leyva Jasso
Excelent trick!
Leslie
anyone know how to limit the log file size and automatically generate a new one? Thank you.
Jonathan Anderson
I use PuTTY for communication with devices over a serial connection. How do I get PuTTY to log my keyboard strokes in addition to what my device sends to the screen? For example, when I use my arrow up key, it logs everything happening on the screen but does not log the escape sequence for my arrow up key.
Vincent
Still works! 6 years later 🙂 I copied putty.exe to c:\windows\system32 and pinned to taskbar to avoid touching the PATH settings.
Bruce Aurand
Thanks.. just what I needed!
Pingback: how to login to putty - Tecdud
Sohbet
Thank you for useful info