ubuntu远程服务部署,Docker,蓝牙无线局域网,SSH,VNC,xfce4,NextTerminal,宝塔,NPS/NPC,gost,openwrt

开机启动

/lib/systemd/system/rc-local.service 添加

[Install]
WantedBy=multi-user.target  
Alias=rc-local.service

/etc/rc.local

#!/bin/sh
添加开机启动需要执行的脚本
sudo chmod 777 /lib/systemd/system/rc-local.service
sudo chmod +x /etc/rc.local
#systemctl disable rc-local.service
systemctl enable rc-local.service
systemctl start rc-local.service
systemctl status rc-local.service

SSH服务

apt update
apt upgrade -y
apt install -y openssh-server

/etc/ssh/sshd_config

PermitRootLogin yes

Docker

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
apt install -y docker-compose

宝塔

wget -O install.sh https://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh ed8484bec

Next-Terminal

docekr-compose up -d

docker-compose.yaml

version: '3.3'
services:guacd:image: registry.cn-beijing.aliyuncs.com/dushixiang/guacd:latestrestart:alwaysnext-terminal:image: registry.cn-beijing.aliyuncs.com/dushixiang/next-terminal-pro:latestenvironment:DB: sqliteGUACD_HOSTNAME: guacdGUACD_PORT: 4822ports:- "8088:8088"volumes:- /etc/localtime:/etc/localtime- ./data:/usr/local/next-terminal/datarestart:always

xfce4

apt install -y xfce4 xfce4-terminal language-pack-zh-hans

/root/.vnc/xstartup

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4

或者

#!/bin/sh
# Start up the standard system desktop
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS/usr/bin/gnome-session[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
x-window-manager 

VNC

apt install -y tigervnc-standalone-servervncpasswd
vncserver -list
vncserver -localhost no :1
vncserver -kill :1

vim /etc/init.d/vncserver_start

#!/bin/sh
### BEGIN INIT INFO
# Provides:          $vncserver_start
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/stop vncserver_start
### END INIT INFO# More details see:
# http://www.penguintutor.com/linux/tightvnc### Customize this entry
# Set the USER variable to the name of the user to start tightvncserver under
export USER='root'
### End customization requiredeval cd ~$USERcase "$1" instart)su $USER -c '/usr/bin/vncserver -localhost no'echo "Starting VNC server for $USER ";;stop)su $USER -c '/usr/bin/vncserver -kill :1'echo "vncserver stopped";;*)echo "Usage: /etc/init.d/vncserver {start|stop}"exit 1;;
esac
exit 0
chmod 777 /etc/init.d/vncserver_start
update-rc.d vncserver_start defaults
systemctl daemon-reload
systemctl status vncserver_start.service 
systemctl enable vncserver_start.service
systemctl start vncserver_start.service

蓝牙无线局域网

apt install bluetooth
apt install blueman
/etc/init.d/bluetooth start

配网指令

mntui

gost

docker-compose.yaml

version: '3.3'
services:gost_t:restart: alwayscontainer_name: gost_timage: gogost/gostnetwork_mode: hostvolumes:- ./gost.yml:/etc/gost.ymlcommand: -C /etc/gost.yml

gost.yml

services:
- name: s5_http_https_proxyaddr: :7080handler:type: autolistener:type: tcp

NPS&NPC

conf/nps.conf

appname = nps
#Boot mode(dev|pro)
runmode = dev#HTTP(S) proxy port, no startup if empty
http_proxy_ip=0.0.0.0
http_proxy_port=480
https_proxy_port=4443
https_just_proxy=true
#default https certificate setting
https_default_cert_file=conf/server.pem
https_default_key_file=conf/server.key##bridge
bridge_type=tcp
bridge_port=8024
bridge_ip=0.0.0.0# Public password, which clients can use to connect to the server
# After the connection, the server will be able to open relevant ports and parse related domain names according to its own configuration file.
public_vkey=123#Traffic data persistence interval(minute)
#Ignorance means no persistence
#flow_store_interval=1# log level LevelEmergency->0  LevelAlert->1 LevelCritical->2 LevelError->3 LevelWarning->4 LevelNotice->5 LevelInformational->6 LevelDebug->7
log_level=7
#log_path=nps.log#Whether to restrict IP access, true or false or ignore
#ip_limit=true#p2p
#p2p_ip=127.0.0.1
#p2p_port=6000#web
web_host=tong.cmclound.com
web_username=admin
web_password=cw
web_port = 4080
web_ip=0.0.0.0
web_base_url=
web_open_ssl=false
web_cert_file=conf/server.pem
web_key_file=conf/server.key
# if web under proxy use sub path. like http://host/nps need this.
#web_base_url=/nps#Web API unauthenticated IP address(the len of auth_crypt_key must be 16)
#Remove comments if needed
#auth_key=test
auth_crypt_key =1234567812345678#allow_ports=9001-9009,10001,11000-12000#Web management multi-user login
allow_user_login=false
allow_user_register=false
allow_user_change_username=false#extension
allow_flow_limit=false
allow_rate_limit=false
allow_tunnel_num_limit=false
allow_local_proxy=false
allow_connection_num_limit=false
allow_multi_ip=false
system_info_display=false#cache
http_cache=false
http_cache_length=100#get origin ip
http_add_origin_header=false#pprof debug options
#pprof_ip=0.0.0.0
#pprof_port=9999#client disconnect timeout
disconnect_timeout=60

nps

version: "3.0"
services:nps_t:image: ffdfgdfg/npshostname: ppycontainer_name: nps_tnetwork_mode: hostvolumes:- ./conf:/confrestart: alwaysprivileged: true

npc

version: '3.3'
services:npc_t:restart: alwayscontainer_name: npc_timage: ffdfgdfg/npcnetwork_mode: hostcommand: -server=tong.cmclound.com:8024 -vkey=flzjzkbn2frjwy6s -type=tcp

docker openwrt

#!/bin/bashnic="enp1s0"
subnet="192.168.31.0/24"
gateway="192.168.31.1"
networkname="onething_wxynet"
containername="openwrt"ip link set ${nic} promisc on
docker network create -d macvlan --subnet=${subnet} --gateway=${gateway} -o parent=${nic} ${networkname}
docker run --restart always --name ${containername} -d --network ${networkname} --privileged sulinggg/openwrt:x86_64  /sbin/init
docker cp ./network ${containername}:/etc/config/network
docker restart ${containername}

network,容器内部的/etc/config/network

config interface 'loopback'option ifname 'lo'option proto 'static'option ipaddr '127.0.0.1'option netmask '255.0.0.0'config interface 'lan'option type 'bridge'option ifname 'eth0'option proto 'static'option netmask '255.255.255.0'option ip6assign '60'option ipaddr '192.168.31.111'option gateway '192.168.31.1'option dns '192.168.31.1'

docker_ubuntu_vnc_ssh_xfce4

Dockerfile

FROM ubuntu
ENV LANG C.UTF-8WORKDIR /homeRUN echo 'root:cw' | chpasswd
RUN printf '#!/bin/sh\nexit 0' > /usr/sbin/policy-rc.d#COPY ./sources.list /etc/apt/sources.listRUN apt update
RUN apt upgrade -yRUN apt install -y openssh-client openssh-server
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
RUN echo "Port 8422" >> /etc/ssh/sshd_config
EXPOSE 8422
RUN apt install -y wget telnet vim make iproute2 net-tools gccRUN apt update
RUN apt upgrade -y
RUN apt install -y xfce4
RUN apt install -y tigervnc-standalone-serverCMD ["/usr/sbin/sshd", "-D"]

docker-compose.yaml

version: '3.1'services:ubuntu_ssh_vnc_t:build: .image: ubuntu_ssh_vnc:v1volumes:  - ./workspace:/workspacecontainer_name: ubuntu_ssh_vnc_tports:- "7922:8422"- "7901:5901"working_dir: /workspacerestart: alwaysprivileged: truetty: truecap_add: - ALL

sources.list

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted
deb http://mirrors.aliyun.com/ubuntu/ focal universe
deb http://mirrors.aliyun.com/ubuntu/ focal-updates universedeb http://mirrors.aliyun.com/ubuntu/ focal multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiversedeb http://security.ubuntu.com/ubuntu/ focal-security main restricted
deb http://security.ubuntu.com/ubuntu/ focal-security universe
deb http://security.ubuntu.com/ubuntu/ focal-security multiverse

workspace/xstartup

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4

NasCab

docker-compose.yaml

version: '3'
services:nascab:image: ypptec/nascabcontainer_name: nascabrestart: alwaysports:- "8760:80"- "5620:90"volumes:- ./data:/root/.local/share/nascab- ./myData:/myData

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/794694.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

漫谈GIS和空间数据库技术

1 GIS和CAD有啥区别 地理信息系统(GIS)和计算机辅助设计(CAD)是两种不同的技术,它们在功能、应用和数据处理方面有着显著的区别。以下是根据搜索结果得出的GIS和CAD的主要区别: 1. **数据处理的侧重点不同…

金陵科技学院软件工程学院软件工程专业

感兴趣的小伙伴可以私信我哦~~ 是笔者写的各种高质量作业和实验哦~~ 感兴趣的小伙伴可以私信我哦~~ 是笔者写的各种高质量作业和实验哦~~ 感兴趣的小伙伴可以私信我哦~~ 是笔者写的各种高质量作业和实验哦~~ 感兴趣的小伙伴可以私信我哦~~ 是笔者写的各种高质量作业和实验哦…

【其他】灾害预警,科技助力:手机地震预警功能设置指导

22024年4月3日7时58分在台湾花莲县海域遭遇了一场7.3级的强烈地震,震源深度12公里,震中位于北纬23.81度,东经121.74度,距台湾岛约14公里。震中5公里范围内平均海拔约-3560米。这场突如其来的自然灾害给当地居民的生活带来了巨大的…

从永远到永远-Git中tag的使用

Git中tag的使用 1.tag的作用2.使用背景3.tag的使用1.种类2.创建标签3.查看标签3.推送标签4. 删除标签: 4.idea可视化操作1.创建标签2.推送标签 999 删除、指定commit、验证暂时不表 1.tag的作用 Tag(标签)用来记录某个特定的提交(commit)。一个 Tag 被用来标记重要的历史节点&…

物联网实战--入门篇之(八)嵌入式-空气净化器

目录 一、风扇调速 二、通讯协议 三、净化器运行逻辑 一、风扇调速 单片机是不能直接驱动电机的,因为主芯片的驱动电流比较小(50mA左右),他们之间正常还要有个电机驱动器,常用的有TB6612、L298和L9110等,目前项目用的这个电机它…

工具篇之Hutool

一、概述 1.1介绍 Hutool是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。 Hutool中的工具方法来自于每个用户的精雕细…

猫头虎技术分享 || 断网了,还能ping127.0.0.1吗?

博主猫头虎的技术世界 🌟 欢迎来到猫头虎的博客 — 探索技术的无限可能! 专栏链接: 🔗 精选专栏: 《面试题大全》 — 面试准备的宝典!《IDEA开发秘籍》 — 提升你的IDEA技能!《100天精通鸿蒙》 …

【数据分析面试】6.计算对话总数(SQL)

题目:计算对话总数 给定了名为 messenger_sends 的消息发送表格,找出总共有多少个唯一的对话。 注:在某些记录中,receiver_id 和 sender_id 从初始消息中互换了。这些记录应视为同一个对话。 示例: 输入&#xff1…

Linux进程控制 Part 1

Linux进程控制 文章目录 Linux进程控制Linux系统任务管理的方法PCB的原型 Linux查看获取进程id的方式现象解释 Linux 进程的状态首先学习查看进程状态的命令常见的几种状态僵尸进程的危害 孤儿进程: 进程优先级概念:PRI and NI查看进程优先级的命令 环境…

wordpress全站开发指南-面向开发者及深度用户(全中文实操)--php函数

php函数 wordpress会封装一部分函数&#xff0c;比如bloginfo该函数的作用是直接调用你设置的你的网站的名称 示例 This is our amazing custom theme <?php echo 22; function myfirstfunction(){ echo 33; echo "<p>Hello ,this is my first function</…

2024-04-02(js)

1.将函数A作为参数传递给函数B&#xff0c;称A为回调函数 2.插件&#xff1a;就是别人写好的一些代码&#xff0c;我们只需要复制对应的代码&#xff0c;就可以直接实现对应的效果 3.js是一种单线程语言&#xff0c;同一时间只能做一件事 4.js先执行完所有的同步任务&#x…

【pycharm】在debug循环时,如何快速debug到指定循环次数

【pycharm】在debug循环时&#xff0c;如何快速debug到指定循环次数 【先赞后看养成习惯】求关注收藏点赞&#x1f600; 在 PyCharm 中&#xff0c;可以使用条件断点来实现在特定循环次数后停止调试。这可以通过在断点处右键单击&#xff0c;然后选择 “Add Breakpoint” -&g…

力扣刷题部分笔记

Leetcode 力扣刷题笔记&#xff0c;记录了几个月来的题目记录&#xff0c;将会继续保持刷题~ 2024.01 1768.交替合并字符串 创建字符串不需要声明长度&#xff08;动态分配内存&#xff09;&#xff0c;push_back()可以加入某个字符&#xff0c;append()一般用于添加字符串…

MySQL基础【语句执行顺序】

一个SQL语句它的执行顺序对于我们思考题意有着很重要的关系 题意就是&#xff1a;找出哪些只逛超市不买单的人&#xff08;买单0元也算哦&#xff0c;可能是使用的是代金券吧&#xff09; 看到此题关键找出两个数据 参观过的人 和 买单的人 他们的差就是白嫖的人&#xff08;支…

包子凑数【蓝桥杯】/完全背包

包子凑数 完全背包 完全背包问题和01背包的区别就是&#xff0c;完全背包问题每一个物品能取无限次。 思路&#xff1a;当n个数的最大公约数不为1&#xff0c;即不互质时&#xff0c;有无限多个凑不出来的&#xff0c;即n个数都可以表示成kn&#xff0c;k为常数且不为1。当n个…

H12-821_182

182.当0SPF运行在广播型网络中时&#xff0c;需要选举DR和BDR。那么以下哪一种状态会进行DR和BDR的选举? A.2-way B.Full C.Exchange D.Init 答案&#xff1a;A 注释&#xff1a; 每台路由器发送的hello报文都有DR字段和BDR字段。 路由器接口刚开始运行OSPF时&#xff0c;在等…

【美团笔试题汇总】2023-09-02-美团春秋招笔试题-三语言题解(CPP/Python/Java)

&#x1f36d; 大家好这里是KK爱Coding &#xff0c;一枚热爱算法的程序员 ✨ 本系列打算持续跟新美团近期的春秋招笔试题汇总&#xff5e; &#x1f4bb; ACM银牌&#x1f948;| 多次AK大厂笔试 &#xff5c; 编程一对一辅导 &#x1f44f; 感谢大家的订阅➕ 和 喜欢&#x1f…

31.2k star, 免费开源的白板绘图工具 tldraw

31.2k star, 免费开源的白板绘图工具 tldraw 分类 开源分享 项目名: tldraw -- 无限画布白板 Github 开源地址&#xff1a; https://github.com/tldraw/tldraw 在线测试地址&#xff1a; tldraw 文档地址&#xff1a; tldraw SDK tldraw 是一款开源免费的无限画布白板&…

HTML5动画设计工具 Hype 4 Pro v4.1.14中文激活版

Hype Pro是一款功能丰富、易用且灵活的HTML5动画设计工具&#xff0c;适用于设计师、开发者和创作者创建各种精美的交互式网页动画。它的强大功能和可视化编辑界面使用户能够快速而轻松地实现复杂的动画效果&#xff0c;同时支持多种输出格式和交互方式&#xff0c;满足用户对网…

Word·VBA文档合并

目录 1&#xff0c;复制法&#xff0c;不保留原文档格式2&#xff0c;复制法&#xff0c;保留原文档格式3&#xff0c;插入法&#xff0c;保留原文档格式 之前的文章《WordVBA实现邮件合并》虽然可以生成邮件合并文档结果&#xff0c;但是不能像《python实现word邮件合并》一样…