2011/09/14

xshell & xftp

簡介

最近比較常接觸到 Linux,因此一個可以連結 ssh 的 tool 是必備的
市面上比較多人用的軟體大致上是這兩種 pietty 以及 putty
putty 可以說是最多人用的,可以選用的項目很多,但這兩套軟體都有一個共通不便的地方
就是他們沒有支援多視窗,也就是說,每要開一個新的 ssh,你就要開一個 putty
相信我,東西處理起來,一口氣開 7-8 個視窗並不奇怪
於是我去找了能夠支援多視窗介面又好用易上手的軟體
讓我找到了 xshell

建議連 xftp 一起 download,可以交互搭配使用

使用

這是安裝好的畫面,他會在你的電腦模擬一個 terminal,可以下達一些指令
輸入 help,可以看到在 terminal 可以使用的功能

Internal Commands:
new:      Creates a new session.
open:     Opens a session or the session dialog box.
edit:     Opens the Session Property dialog box for a session.
list:     Lists information of all available sessions.
          'ls' and 'dir' do the same.
cd:       Changes the current working directory.
clear:    Clears the screen/address/command history.
help:     Displays this help. '?' does the same.
quit:     Quits Local Shell. 'exit' does the same.
ssh:      Connects to a host using the SSH protocol.
telnet:   Connects to a host using the TELNET protocol.
rlogin:   Connects to a host using the RLOGIN protocol.
sftp:     Connects to a host to transfer files securely.
ftp:      Connects to a host to transfer files.

External Commands:
ipconfig: Configures TCP/IP network interfaces.
ping:     Sends ICMP ECHO_REQUEST packets to network hosts.
tracert:  Prints the route packets take to network host.
netstat:  Displays current protocol statistics and current
          TCP/IP network connections.
nslookup: Resolves a hostname to IP address.

For more information, type 'help command' for each command.
ex) help telnet
Xshell:\> clear
Xshell:\> help
Internal Commands:
new:      Creates a new session.
open:     Opens a session or the session dialog box.
edit:     Opens the Session Property dialog box for a session.
list:     Lists information of all available sessions.
          'ls' and 'dir' do the same.
cd:       Changes the current working directory.
clear:    Clears the screen/address/command history.
help:     Displays this help. '?' does the same.
quit:     Quits Local Shell. 'exit' does the same.
ssh:      Connects to a host using the SSH protocol.
telnet:   Connects to a host using the TELNET protocol.
rlogin:   Connects to a host using the RLOGIN protocol.
sftp:     Connects to a host to transfer files securely.
ftp:      Connects to a host to transfer files.

External Commands:
ipconfig: Configures TCP/IP network interfaces.
ping:     Sends ICMP ECHO_REQUEST packets to network hosts.
tracert:  Prints the route packets take to network host.
netstat:  Displays current protocol statistics and current
          TCP/IP network connections.
nslookup: Resolves a hostname to IP address.

For more information, type 'help command' for each command.
ex) help telnet

在 terminal mode 輸入 new,或者是按下導覽列的 new 按鈕
變可以建立新的帳戶,可以使用的功能有 ssh、telnet、rlogin、sftp、serial
目前常用到的應該就是

  1. ssh:用來連結 Linux Server
  2. telnet:連結 bbs 如 ptt
  3. sftp:直接透過此模式存取 server 檔案

在 Connection 填入Name 跟 Host 之後,點選 Authentication
可以選擇 Password、Public Key 以及 Keyboard Interactive 模式連結 Server
基本上這樣就可以使用了,也可以針對不同的 case 來設定不同的內容
如語系(點選 Terminal 後選擇下方 Encoding)

以 bbs 為例,預設的字型跟字級大小要瀏覽 ptt 很吃力 於是我點選了 Apperance,將 Font Name 改為細明體,Font Size 改為 14

這樣看 ptt 就很舒服了

指令模式

讓我們回到 terminal 模式,ls 後 enter,可以列出你所有建立的帳戶
使用 open 後接你的帳戶,如 open ptt,便會連去 ptt
如果你想不建立任何帳戶,直接連線,可以直接下指令
ssh 123.123.123.123 或是 telnet ptt.cc

External Commands:
ipconfig: Configures TCP/IP network interfaces.
ping:     Sends ICMP ECHO_REQUEST packets to network hosts.
tracert:  Prints the route packets take to network host.
netstat:  Displays current protocol statistics and current
          TCP/IP network connections.
nslookup: Resolves a hostname to IP address.

像這些在 dos command line 常用的指令也可以在他的 terminal 使用

Toolbar

上述的所有功能都可以在最上方的 toolbar 找到對應的按鈕

設定

再來我們看一下 Options 幾個我覺得比較實用的內容
點選 Options、Advanced,我溝選了 Minimize to system tray
這樣當不使用的時候可以將 xshell 縮到 tray,少佔用了一個 CTRL+TAB 的切換空間,很方便
我另外將 Confirm connection close whe Xshell exitst 以及 Confirm connection close when a session 打勾取消
這樣我要關閉任何視窗時他都不會再詢問我

xftp

當你使用 ssh 進去某個帳戶之後,按下快捷鍵 CTRL+ALT+F
便可以叫出 xftp,讓你在視窗介面直接可以使用檔案傳輸的功能,是不是非常方便呢

快捷鍵一覽表

Shortcut key Description
Alt + N Same as New on the File menu.
Alt + O Same as Open on the File menu.
Alt + C Same as Close on the File menu.
Alt + Enter Changes to Full Screen view.
Alt + D Moves the keyboard focus to the Address bar.
Alt + Right Same as Next on the Window menu.
Alt + Left Same as Previous on the Window menu.
Ctrl + D Exit the Xshell on the local prompt.
Ctrl + Alt + ] Escape to the local prompt while connecting to a remote computer.
Ctrl + Alt + T Same as New Terminal on the Window menu.
Ctrl + Alt + F Same as New File Transfer on the Window menu.
Ctrl + Tab Switches to the next session within the same Xshell window.
Ctrl + Shift + Tab Switches to the previous session within the same Xshell window.
Shift + Home Scroll to Top.
Shift + End Scroll to Bottom.
Shift + PgUp Scroll Page Up.
Shift + PgDn Scroll Page Down.
Shift + Up Arrow Scroll Up.
Shift + Down Arrow Scroll Down.

沒有留言: