备用shell管理方案之butterfly+nginx+https
安装butterfly+nginx https
1. 安装butterfly
yum install python36 python36-pip python36-devel -y
pip install butterfly
pip install butterfly[themes] # If you want to use themes
pip install butterfly[systemd] # If you want to use systemd
butterfly
1.1 注册systemd服务
cd /etc/systemd/system
curl -O https://raw.githubusercontent.com/paradoxxxzero/butterfly/master/butterfly.service
curl -O https://raw.githubusercontent.com/paradoxxxzero/butterfly/master/butterfly.socket
systemctl enable butterfly.socket
systemctl start butterfly.socket
1.3 配置butterfly为非安全模式,我们使用nginx来提供https服务
使用sshd授权登录方式.
vim /etc/systemd/system/butterfly.service
[Unit]
Description=Butterfly Terminal Server
[Service]
ExecStart=/usr/local/bin/butterfly.server.py --unsecure --login --pam_profile=sshd
1.4 重新启动服务即可
systemctl restart butterfly.socket
- nginx的配置文件
- 设置
server {
listen 443 ssl;
server_name servername;
ssl_certificate /home/makeit/.keys/fullchain.pem;
ssl_certificate_key /home/makeit/.keys/keys.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
auth_basic "input you passwd";
auth_basic_user_file passwd.db;
location / {
proxy_pass http://127.0.0.1:575575;
proxy_read_timeout 300s;
proxy_connect_timeout 300s;
#后端证书文件,如果后端开启https
#proxy_ssl_certificate /etc/butterfly/ssl/butterfly_ca.crt;
#proxy_ssl_certificate_key /etc/butterfly/ssl/butterfly_ca.key;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-F $remote_addr;
proxy_http_version 1.1; #代理websocket
proxy_set_header Upgrade "websocket";
proxy_set_header Connection "Upgrade";
proxy_set_header Sec-Websocket-Version 13;#重要
proxy_set_header Connection ""; #防止客户端close,后端也close了
}
后端设置自签证书,连上后就close了. 没弄好,

改成后端使用非安全模式才可以的.

参考:
https://github.com/paradoxxxzero/butterfly
https://www.xncoding.com/2018/03/12/fullstack/nginx-websocket.html
https://ma.ttias.be/enable-keepalive-connections-in-nginx-upstream-proxy-configurations/
https://www.serverlab.ca/tutorials/linux/web-servers-linux/how-to-proxy-wss-websockets-with-nginx/
https://www.hi-linux.com/posts/42176.html
备用shell管理方案之butterfly+nginx+https的更多相关文章
- 利用nc当作备用shell管理方案.
ssh 有时候真的就是连不上了,然后是没什么然后了呢. 或者手残改错配置然后重新sshd了. 所以这时候需要备用的远程管理工具.nc是最好的选择,一般服务器都是 内网的,如果跳板机也管理不了呢. 安装 ...
- Nginx https加密以及nginx日志配置与管理
Nginx https加密以及nginx日志配置与管理 使用Nginx的优点Nginx作为WEB服务器,Nginx处理静态文件.索引文件.自动索引的效率非常高.Nginx作为代理服务器,Nginx可以 ...
- (转)flutter 新状态管理方案 Provide (一)-使用
flutter 新状态管理方案 Provide (一)-使用 版权声明:本文为博主原创文章,基于CC4.0协议,首发于https://kikt.top ,同步发于csdn,转载必须注明出处! ...
- 【云计算】Docker 多进程管理方案
docker容器内多进程的管理方案 时间 2015-05-08 00:00:00 涯余 ...
- 【云计算】Docker多进程管理方案-cfengine && supervisord
docker容器内多进程的管理方案 时间 2015-05-08 00:00:00 涯余 原文 http://yayua.github.io/docker/container-process-moni ...
- 你必须知道的容器日志 (2) 开源日志管理方案 ELK
本篇已加入<.NET Core on K8S学习实践系列文章索引>,可以点击查看更多容器化技术相关系列文章.上一篇<你必须知道的容器日志(1)>中介绍了Docker自带的log ...
- flutter最简单轻量便捷的路由管理方案NavRouter
大家好,我是CrazyQ1,今天给大家推荐一个路由管理方案,用的非常不错的,叫nav_router. 项目地址是:https://github.com/fluttercandies/nav_route ...
- 17、Nginx HTTPS 实践
1.HTTPS安全证书基本概述 为什么需要使用HTTPS, 因为HTTP不安全.当我们使用http网站时,会遭到劫持和篡改,如果采用https协议,那么数据在传输过程中是加密的,所以黑客无法窃取或者篡 ...
- 如何实现shell并发 一个入门级可控多线程shell脚本方案
如何实现shell并发 很多人都问我如何写shell脚本,如何实现同时给三台ftp服务器上传文件,如何同时检测三台服务器是否alive等,其实这就是想实现shell的并发.那么shell并 ...
随机推荐
- treeMultiselect 去掉勾选项
场景描述:弹窗,显示树形结构,节点层次可变(可只有一级节点,也可是多级节点),限制只能选择一个节点! 1.修改jquery.tree-multiselect.min.js 文件 2.前台页面 参考代码 ...
- Python之TensorFlow的卷积神经网络-5
一.卷积神经网络(Convolutional Neural Networks, CNN)是一类包含卷积计算且具有深度结构的前馈神经网络(Feedforward Neural Networks),是深度 ...
- H5打开app指定页面(H5+app项目)
H5+app项目,在HBuilderX中设置 详情参考官方 https://ask.dcloud.net.cn/article/64 给h5+app设置scheme值,作用:在其它app和h5页面中启 ...
- Tomcat - 启动闪退
版本:Tomcat 9 问题:启动闪退.在控制台中输入"java -version"可以正常输出java的版本信息,但是使用start.bat启动时候闪退. 解决方法:配置系统环境 ...
- Arm存储器
Arm可以引出27根地址线,只能实现128MB的寻址,那么要如何实现1GB的寻址呢?答案就是使用nGCS片选线,nGCSx为低电平为选中相应的外接设备.一共八根片选线,也就是bank1,bank2-以 ...
- Nacos Docker集群部署
参考文档:https://nacos.io/zh-cn/docs/quick-start-docker.html 1.从git上下载nacos-docker项目,本地目录为/docksoft/naco ...
- python(列表函数)
一.列表函数 1.sort()原址排序 参数默认reverse=False时为正序排序 list1 = [1,3,5,2,1,23,18] list1.sort() print (list1) 当参数 ...
- DELL R730 做raid10
1.服务器开机,在出现下图提示时,同时按着<ctrl >+ < R >键,即可进入配置界面 2.会进入下图 3.按上下键到第一项PERC H730P MINI ,按F2,选择c ...
- 190919 python水仙花数
# 打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,# 其各位数字立方和等于该数本身.例如:153是一个"水仙花数",# 因为15 ...
- sqlite3入门之sqlite3_get_table,sqlite3_free_table
sqlite3_get_table sqlite3_get_table函数原型: int sqlite3_get_table( sqlite3 *db, /* An open database */ ...