0、前置条件,centos主机安装了python3和nginx
 
1、安装webssh
pip3 install webssh
 
2、添加自定义服务

systemctl cat webssh
# /usr/lib/systemd/system/webssh.service
[Unit]
Description=WebSSH terminal interface
After=network.target [Service]
ExecStart=/bin/bash -c "/usr/local/share/python3/bin/wssh --address='127.0.0.1' --port=6666"
#ExecStart=/usr/local/share/python3/bin/wssh [Install]
WantedBy=multi-user.target

  

 
查看服务状态

systemctl daemon-reload
systemctl restart webssh
systemctl status webssh
 
3、nginx添加反向代理(/etc/nginx/conf.d)

conf.d]# cat webssh.conf
server {
listen 8888;
root /var/www/html; location / {
proxy_pass http://127.0.0.1:6666;
proxy_http_version 1.1;
proxy_read_timeout 300;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
} }
 
index.html路径
/usr/local/share/python3/lib/python3.10/site-packages/webssh/templates
解决报错libssl.so.1.1: cannot open shared object file: No such file or directory
#从官网下载
# wget https://www.openssl.org/source/openssl-1.1.1e.tar.gz #腾讯云提供的镜像
wget https://mirrors.cloud.tencent.com/openssl/source/openssl-1.1.1e.tar.gz tar -xvf openssl-1.1.1e.tar.gz
./config shared --openssldir=/usr/local/openssl --prefix=/usr/local/openssl
make && make install echo "/usr/local/lib64/" >> /etc/ld.so.conf
ldconfig #验证版本
openssl version
 
 
 

最新文章

  1. 用vue2 +vue-router2 + es6 +webpack 高仿饿了么app(干货满满)
  2. Webstorm常用的快捷键
  3. 搭建java环境
  4. HTTPS的一些疑问解答
  5. Thread 总结
  6. CSS媒体查询(@media)
  7. border-radius 样式表CSS3圆角属性
  8. appium-UI automator viewer 无[ resource-id ]项
  9. 360抢票 网站维护中 && 你的登录被踢了!
  10. HDU_2030——统计文本中汉字的个数
  11. 设置edittext的hint位置
  12. MFC 可以设置背景色、字体、字体颜色、透明背景的 Static 静态文本控件
  13. Codeforces Round #246 (Div. 2) D. Prefixes and Suffixes(后缀数组orKMP)
  14. PHP 魔术方法 __call 与 __callStatic 方法
  15. 02-线性结构4 Pop Sequence
  16. Webservice接口的调用
  17. Python学习-使用opencv-python提取手掌和手心及部分掌纹
  18. centos 6.5安装并配置mysql
  19. 基于one2team框架的Highcharts图表图片导出方案
  20. Spark-RDD之Partition源码分析

热门文章

  1. [转载]危险操作一追到底--Linux的历史记录
  2. 常见的git操作
  3. combox下拉框控件
  4. mysql库操作msyql
  5. go项目,出现too many open files
  6. Pycharm 2022.2激活码到2023年7月,亲测有效
  7. 如何在mac上配置Apache服务器
  8. 【Linux】Linux网络编程
  9. ntp子母钟(gps子母钟系统)时钟系统在智能交通系统中的重要性
  10. ENGG1310 Electricity and electronics P1.2 Electronic Communication