Django+paramiko 实现的 webssh。此项目存在已知BUG,最新请参考:https://github.com/leffss/devops
基于 python3.7 + django 2.2.3 实现的 django-webshell,参考 https://github.com/huyuan1999/django-webssh 。在参考项目的基础上做了一些优化:新增前端页面刷新确认页面(刷新会导致 websocket 连接断开)、后端 paramiko 线程创建代码优化、记录命令记录以及结果、支持 zmodem 上传下载文件(rz, sz)。有兴趣的同学可以在此基础上稍作修改集成到自己的堡垒机中。
pip3 install -r requirements.txt
cd django-webssh/webssh/
python3 manage.py runserver 0.0.0.0:8000
```
访问:http://127.0.0.1:8000
## 预览
![](https://github.com/leffss/django-webssh/blob/master/screenshots/1.PNG?raw=true)
![](https://github.com/leffss/django-webssh/blob/master/screenshots/2.PNG?raw=true)
![](https://github.com/leffss/django-webssh/blob/master/screenshots/3.PNG?raw=true)
![](https://github.com/leffss/django-webssh/blob/master/screenshots/4.PNG?raw=true)
![](https://github.com/leffss/django-webssh/blob/master/screenshots/5.PNG?raw=true)
![](https://github.com/leffss/django-webssh/blob/master/screenshots/6.PNG?raw=true)
![](https://github.com/leffss/django-webssh/blob/master/screenshots/7.PNG?raw=true)