在公有云上,我們常看到通過瀏覽器能向遠程的服務器發送命令,初看是不是很神奇。 今天我們用shellinabox為例來體驗一下,shellinabox是一款基于 Web 的遠程 Terminal 開源模擬器軟件,本篇文章基于centos7.3環境。
安裝 EPEL yum源
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
yum repolist
安裝shellinabox,關閉https
默認配置文件我們只加了一個-t 指明不以 SSL 運行,來關閉https,啟動服務時會自動產生證書。
yum -y install shellinabox
vim /etc/sysconfig/shellinaboxd
--
OPTS="--disable-ssl-menu -t -s /:LOGIN"
--
systemctl start shellinaboxd
[root@pangu ~]# ls /var/lib/shellinabox/
certificate-localhost.pem certificate.pem
新建普通用戶
useradd icai
passwd icai
本地測試連接
curl -I http://10.10.10.128:4200 ,狀態碼返回200OK,測試通過
遠程連接
通過chrome訪問http://10.10.10.128:4200/ ,用普通用戶 icai
登錄成功。
login.PNG
關于深層次的東西,如何支持https,shellinabox實現方式,大家可以自己研究一下。
相關開源軟件:
Gate One http://liftoffsoftware.com/Products/GateOne
wssh https://github.com/aluzzardi/wssh
Ajaxterm https://github.com/antonylesuisse/qweb
Anyterm http://anyterm.org/
Commando.io http://commando.io/
tty.js https://github.com/chjj/tty.js/
KeyBox http://sshkeybox.com/
Webmin http://www.webmin.cn/