天天看點

使用浏覽器通路 Linux 終端

wssh 可以讓我們通過 HTTP 來調用遠端的一個 shell,也就是說我們可以用浏覽器來通路某個 Linux 伺服器/虛拟機的終端(隻要這個伺服器上運作了 wsshd 伺服器端)。wssh 用戶端通過 ssh 帳号連接配接到 wsshd 伺服器端。wssh 更多的是當作庫來開發一些應用,比如開發雲計算、虛拟機背景控制台的虛拟機控制台等等。我們先來玩一下簡單的~

安裝一些必要軟體:

$ sudo apt-get install git gcc python libevent-dev python-dev python-pip
      

安裝 wssh 需要的各種 Python 庫:

$ sudo pip install gevent gevent-websocket paramiko flask
      

下載下傳并安裝 wssh:

$ git clone https://github.com/aluzzardi/wssh.git
$ cd wssh
$ sudo python setup.py install
      

運作 wsshd:

$ wsshd
wsshd/0.1.0 running on 0.0.0.0:5000
      

從浏覽器打開 http://IP:5000 後會看到如下登陸界面:

使用浏覽器通路 Linux 終端

使用 ssh 帳号登陸後就可以看到終端了:

使用浏覽器通路 Linux 終端

發表評論(8 Comments)分類:Linux | BSD | Solaris

評論 (8 Comments)

  1. Penn_Gregory - June 14th, 2013 8:19 pm

    看上去非常酷, 這樣在外連putty都不需要了.

  2. 哥 - June 17th, 2013 12:10 pm

    cool,但是不能設定主機端口,如果不是22就麻煩了,有辦法嗎?

  3. Anonymous - June 22nd, 2013 12:57 pm

    為什麼我連上去頁面是空白的,好像沒有websocket module

  4. vpsee - June 22nd, 2013 8:05 pm

    可能你的浏覽器不支援,試一下 Safari 或最新的 Chrome.

  5. Steve Fan - June 23rd, 2013 9:31 pm

    安裝了不能用誒…點connect白白的…用的是ubuntu 12.10和chrome 27…

  6. vir - July 14th, 2013 12:09 pm
  7. dongwm - July 19th, 2013 7:17 pm
  8. itnihao - August 30th, 2013 1:14 pm