GateOne是套web base的終端模擬器,配合SSL和SSH,可以在只能走port 80的環境中還能
而GateOne用起來雖然方便,但軟體需求Python 2.6 以上,在預設安裝 2.4 版的CentOS 5.5 上會有些問題,簡單記錄一下排除步驟..
是的,我知道CentOS出到 6.3 了,只是... 有神仙能做,誰要當畜牲啊... orz
先裝裝Python會用到的一些函式庫
shell> yum install openssl-devel
shell> yum install readline-devel
shell> yum install ncurses-devel
shell> yum install pam-devel
安裝 Python 2.7
shell> mkdir -p /home/python/src
shell> cd /home/python/src
shell> wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
shell> tar zxvf Python-2.7.3.tgz
shell> cd Python-2.7.3
shell> ./configure --prefix=/home/python/ --enable-shared --with-ssl
shell> make; make install
設定library path
shell> echo "/home/python/lib" >> /etc/ld.so.conf.d/python.conf
shell> ldconfig
確認一下是否安裝成功
shell> ldconfig -p | grep python
libpython2.7.so.1.0 (libc6,x86-64) => /home/python/lib/libpython2.7.so.1.0
libpython2.7.so (libc6,x86-64) => /home/python/lib/libpython2.7.so
然後把Python目錄加進你的PATH中,方便之後工作
shell> export PATH=$PATH:/home/python/bin
安裝GateOne 需要的 tornado 模組
shell> cd /home/python/src
shell> wget https://github.com/downloads/facebook/tornado/tornado-2.4.1.tar.gz --no-check-certificate
shell> tar zxvf tornado-2.4.1.tar.gz
shel> cd tornado-2.4.1
shell> python2.7 setup.py build
shell> python2.7 setup.py install
安裝 PAM 認證用的 Python 模組,如果沒有要用 PAM 認證,可以不用裝,而官網建議裝的是 python-pam,晚點再來試試。
shell> cd /home/python/src
shel> wget http://pkgs.fedoraproject.org/repo/pkgs/PyPAM/PyPAM-0.5.0.tar.gz/f1e7c2c56421dda28a75ace59a3c8871/PyPAM-0.5.0.tar.gz
shell> tar zxvf PyPAM-0.5.0.tar.gz
shell> cd PyPAM-0.5.0
shell> python2.7 setup.py build
shell> python2.7 setup.py install
安裝正主兒 GateOne
shell> mkdir -p /home/gateone/src
shell> cd /home/gateone/src
shell> wget https://github.com/downloads/liftoff/GateOne/gateone-1.1.tar.gz --no-check-certificate
shell> tar zxvf gateone-1.1.tar.gz
shell> cd GateOne/
shell> python2.7 setup.py build
# 不加 --prefix 會裝到 /opt 去
shell> python2.7 setup.py install --prefix=/home
之後執行GateOne一次讓它生出設定檔 server.conf (很奇怪的安裝邏輯,可能是要用程式偵測環境參數吧)
shell> /home/gateone/gateone.py
如果正常跑起來,那當神仙去吧,如果出現SyntaxError
原因出在有幾個檔案前頭寫了 #!/usr/bin/env python ... 有點眼熟,有點怪怪的對吧,沒錯,它還是會去用舊版的Python跑...乖乖繼續當畜牲吧..
先找出那些檔案寫了這些鬼東西
shell> cd /home/gateone
shell> grep -r '#!/usr/bin/env python' *
應該會有下列三個檔案要改
gateone.py
logviewer.py
plugins/ssh/scripts/ssh_connect.py
結束了嗎 ? 沒有,因為還有支該死的remote_syslog.py寫成 !#/usr/bin/python,抓出來一起改一改
就可以開心的
p.s 預設的server.conf不用改什麼就可運作,但 auth 這個屬性本來是none,建議改成 pam 或是偷懶用 google 都好,安全至上...
Ref :
- http://liftoff.github.com/GateOne/About/index.html
- http://liftoff.github.com/GateOne/Developer/gateone.html
0 意見:
張貼留言