網頁

2014年12月15日 星期一

SSH Tunnel

簡單註記

在 server 2008 安裝,需先做以下操作(以前的註記與現況有可能不同)

chmod +r /etc/group
chmod +r /etc/passwd
chmod +rwx /var

然後再安裝 ssh server (ssh-host-config),安裝好後,別忘了把 ssh 的帳號權限設小一點

  1. OS修改環境變數:path增加d:\cygwin\bin ->現在不用這樣子做
  2. OS增加環境變數:CYGWIN=ntsec tty
  3. Cygwin安裝必要的套件:OpenSSH,cygrunsrv
  4. Cygwin設定OpenSSH:
    • 執行 ssh-host-config
    • Should privilege separation be used? (yes/no) :yes
    • Should this script create a local user 'sshd' on this machine? (yes/no) :yes
    • Do you want to install sshd as service? (yes/no) :yes
    • Default is "ntsec" . CYGWIN=ntsec tty
  5. 手動啟動OpenSSH服務:net start sshd
  6. 手動關閉OpenSSH服務:net stop sshd
  7. run Cygwin password 更新

Cygwin password 更新

mkpasswd   --local   >   /etc/passwd
mkgroup   --local    >   /etc/group

以前做法。現在只要作業系統上的變更後會自動更新。

Cygwin Mount and Unmount

mount d:/work/tomcat /usr/local/tomcat
umount /usr/local/tomcat
其它可參考Cygwin 內之說明

SSH Tunnel 的應用設定

Putty 的設定
按平常的設定設定即可 (e.g Sources port :5959 and Destination is localhost:5959)
由於在透過 browser 透過 ssh 使用,所以需要額外設定,設定方式如右Source port : 8888 (那一個port 都可以),選擇 Dynamic 後即可。
在 firefox 內的設定方式只需指定主機Ip位址,連接埠同 tunnel 的設定(例如 8888),socks 代理伺服器指定 SOCKS va4/4a。

其它相關資料:

沒有留言:

張貼留言