与Linux打交道,免不了要从Windows上SSH到Linux或者在Windows和Linux之间传文件。平时我比较常用的就是SSH Secure Shell和Putty。
SSH Secure Shell有比较好用的文件传输GUI工具,但是终端工具不支持编码选择,一直受中文乱码困扰,除非你更改服务器的编码,另外版本比较旧了现在用的基本都是2003年的3.2.9版本。
由于SSH Secure Shell中文乱码的原因,有时不得不使用Putty,但是一直比较郁闷Putty下复制文字的方法,前段时间偶然看Putty的帮助文档,看到以下内容:
PuTTY's copy and paste works entirely with the mouse. In order to copy text to the clipboard, you just click the left mouse button in the terminal window, and drag to select text. When you let go of the button, the text isautomatically copied to the clipboard. You do not need to press Ctrl-C or Ctrl-Ins; in fact, if you do press Ctrl-C, PuTTY will send a Ctrl-C character down your session to the server where it will probably cause a process to be interrupted.
Pasting is done using the right button (or the middle mouse button, if you have a three-button mouse and have set it up; see section 4.11.2). (Pressing Shift-Ins, or selecting ‘Paste’ from the Ctrl+right-click context menu, have the same effect.) When you click the right mouse button, PuTTY will read whatever is in the Windows clipboard and paste it into your session,exactly as if it had been typed at the keyboard. (Therefore, be careful of pasting formatted text into an editor that does automatic indenting; you may find that the spaces pasted from the clipboard plus the spaces added by the editor add up to too many spaces and ruin the formatting. There is nothing PuTTY can do about this.)
好吧,原来Putty里,选择即复制,右键即粘贴。另外Putty还提供自己的scp工具——pscp,以后可以把SSH Secure Shell丢角落里,一心一意用Putty了。。。
另外推荐几篇SSH相关的文章: