在公有云上,我們常看到通過瀏覽器能向遠(yuǎn)程的服務(wù)器發(fā)送命令,初看是不是很神奇。 今天我們用shellinabox為例來體驗(yàn)一下,shellinabox是一款基于 Web 的遠(yuǎn)程 Terminal 開源模擬器軟件,本篇文章基于centos7.3環(huán)境。
安裝 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,關(guān)閉https
默認(rèn)配置文件我們只加了一個(gè)-t 指明不以 SSL 運(yùn)行,來關(guān)閉https,啟動服務(wù)時(shí)會自動產(chǎn)生證書。
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 ,狀態(tài)碼返回200OK,測試通過
遠(yuǎn)程連接
通過chrome訪問http://10.10.10.128:4200/ ,用普通用戶 icai
登錄成功。
login.PNG
關(guān)于深層次的東西,如何支持https,shellinabox實(shí)現(xiàn)方式,大家可以自己研究一下。
相關(guān)開源軟件:
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/