Monday, February 18, 2013

Remote access to linux via SSH using Putty (and draw lines correctly)

Update 2014: Actually, it's pretty simple to solve all these things, when using Ubuntu 12.04 (US English) and Putty 0.63. I didn't check other distros. Configure Putty like this:
- Terminal >> Keyboard >> The Function keys and keypad = Linux
- Window >> Translation >> Remote Character set = UTF-8
All works great!



When logged in from a Putty terminal, some programs render correctly the bars made of characters using in putty UTF-8, while others render them correctly using ISO-8859-1:1998 (Latin-1, West Europe) in Putty settings. I haven't found a nice way to deal with this problem, and I'm gonna keep a log of programs' preferred way.

UTF-8: hddtemp, links, links2, lm-sensors, mc, moc, smartmontools,
ISO-8859: alsamixer, elinks, iptraf, mp3blaster, sysv-rc-conf, wavemon

Keep in mind that this is related to the way server's locale is configured. My server locale shows the following output:
server:~# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=


What to do: configure ssh client in other systems (Putty) to use UTF-8 and match server's locale to get nice display of man pages and character bars of some programs. The optimum settings I have found so far are the following:
- Window >> Translation >> Remote Character Set >> UTF-8
- Connection >> Data >> Terminal-type string >> linux


Other Putty settings I choose to alterate from default:
- Lines of scrollback = 900
- Window title (i.e. "[root@server1.example.com]", without quotes)
- Auto-login username (i.e. "root", without quotes)
- Enable compression
- Permit only protocol version 2


https://bbs.archlinux.org/viewtopic.php?pid=511920
http://www.andremiller.net/content/getting-midnight-commander-line-drawing-work-putty
http://rc.quest.com/topics/putty/doc.php#config-linedraw
http://blog.sanctum.geek.nz/putty-configuration/
http://sourceforge.net/p/nmon/bugs/4/
http://superuser.com/questions/393834/how-to-configure-putty-to-display-these-characters
http://www.thegeekstuff.com/2009/07/10-practical-putty-tips-and-tricks-you-probably-didnt-know/



Last update: 2013.03.18

No comments: