使用webssh在网页上ssh连接服务器
在服务器上部署webssh,通过网页ssh登录服务器
安装
方式一 pip安装
pip3 install webssh
方式二 源码安装
git clone https://github.com/huashengdun/webssh.git
cd webssh && python setup.py install
启动
wssh
#默认8888端口
wssh --address='192.168.2.57' --port=1000
wssh --address='0.0.0.0' --port=1000
wssh --address='127.0.0.1' --port=1000
#指定监听IP、端口
nohup wssh --address='0.0.0.0' --port=1000 --fbidhttp=False &
#后台运行,--fbidhttp=False参数开放http请求
连接
1确保防火墙已放行
2确保/etc/ssh/sshd_config 开启 PermitRootLogin yes
3浏览器访问 http://192.168.1.2:1000
#不但可以连接本机127.0.0.1,还能连接同局域网其他主机192.168.2.x
#复制粘贴也有效,很方便