当前位置: 首页 > news >正文

快速部署远程vnc桌面 -docker部署

快速部署多用户独立桌面的远程vnc桌面 -docker部署

  • 远程桌面与浏览器配置
    • 1 启动远程桌面 服务器
    • 2 添加apt-get 软件 安装源aliyun more /etc/apt/sources.list.d/aliyun.list
    • 3 更新软件源 apt-get update
    • 4 添加系统用户
    • 5 添加vnc远程用户密码
    • 6 配置远程用户及默认端口
    • 7 多用户各自独立桌面启动
      • 批量创建用户 useradd -m cnhz1
    • 批量配置vncpasswd

远程桌面与浏览器配置

多用户各自独立桌面的vnc配置,需要配置如下:
1)启动服务器,配置服务器。
1)添加远程登录用户,
2)给每个用户提供一个vncserver 监听端口

1 启动远程桌面 服务器

## docker run  --name ubuntu3   -d  -p "35901-35911:5901-5911"    -p "36901:6901" -e "VNC_PW=123456"  --user 2000:3000  hub.rat.dev/accetto/ubuntu-vnc-xfce-firefox-g3-hz

2 添加apt-get 软件 安装源aliyun more /etc/apt/sources.list.d/aliyun.list

root@ccf1871a5f01:~# more /etc/apt/sources.list.d/aliyun.listdeb https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse# deb https://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverseroot@ccf1871a5f01:~# apt-get update 

3 更新软件源 apt-get update


root@ccf1871a5f01:~# apt-get update 
root@ccf1871a5f01:~#   apt-get install vim

4 添加系统用户

添加 多用户 cnhz1 到 cnhz10


root@ccf1871a5f01:~# useradd -m  cnhz1root@ccf1871a5f01:~# passwd  cnhz1

5 添加vnc远程用户密码

多用户 cnhz1 到 cnhz10

 普通用户 执行
cnhz1@ccf1871a5f01:~$  vncpasswd cnhz1
Password:
Verify:
Would you like to enter a view-only password (y/n)? y
Password:
Verify:

6 配置远程用户及默认端口

多用户 cnhz1 到 cnhz10


root@ccf1871a5f01:~# vi /etc/tigervnc/vncserver.users
root@ccf1871a5f01:~# more  /etc/tigervnc/vncserver.users
# TigerVNC user assignment
#
# This file assigns users to specific VNC display numbers.
# The syntax is <display>=<username>. E.g.:
#:2=cnhz2
:3=cnhz3:12=andrew
:13=lisa

7 多用户各自独立桌面启动


root@ccf1871a5f01:~# more vncserver.sh
# nohup sudo -u test1 vncserver :4 -geometry 1920x1080 -depth 24 &
nohup sudo -u cnhz1 vncserver :1  &
nohup sudo -u cnhz2 vncserver :2  &
nohup sudo -u cnhz3 vncserver :3  &
nohup sudo -u cnhz4 vncserver :4  &
nohup sudo -u cnhz5 vncserver :5  &
nohup sudo -u cnhz6 vncserver :6  &
nohup sudo -u cnhz7 vncserver :7  &
nohup sudo -u cnhz8 vncserver :8  &
nohup sudo -u cnhz9 vncserver :9  &nohup sudo -u cnhz10 vncserver :10  &
nohup sudo -u cnhz11 vncserver :11  &root@ccf1871a5f01:~# ./vncserver.sh

更新版本脚本:

root@ccf1871a5f01:~# more vncserver.sh
# nohup sudo -u test1 vncserver :4 -geometry 1920x1080 -depth 24 &
# nohup sudo -u cnhz1 vncserver :1   > nohup_cnhz1.log 2>&1 &
nohup sudo -u cnhz2 vncserver :2  > nohup_cnhz2.log 2>&1 &
nohup sudo -u cnhz3 vncserver :3  > nohup_cnhz3.log 2>&1 &
nohup sudo -u cnhz4 vncserver :4  > nohup_cnhz4.log 2>&1 &
nohup sudo -u cnhz5 vncserver :5  > nohup_cnhz5.log 2>&1 &
nohup sudo -u cnhz6 vncserver :6  > nohup_cnhz6.log 2>&1 &
nohup sudo -u cnhz7 vncserver :7  > nohup_cnhz7.log 2>&1 &
nohup sudo -u cnhz8 vncserver :8  > nohup_cnhz8.log 2>&1  &
nohup sudo -u cnhz9 vncserver :9  > nohup_cnhz9.log 2>&1 &nohup sudo -u cnhz10 vncserver :10  > nohup_cnhz10.log 2>&1 &
nohup sudo -u cnhz11 vncserver :11  > nohup_cnhz1.log 2>&1 &
root@ccf1871a5f01:~#

批量创建用户 useradd -m cnhz1

批量配置vncpasswd

使用该用户登录, cnhz3登录, 运行vncpasswd

cnhz3@ccf1871a5f01:~# vncpasswd

特别注意一定需要创建 此用户目录下的 vncpasswd 文件

http://www.dtcms.com/a/558655.html

相关文章:

  • 网站建设运行状况做网站需要服务器还是主机
  • 网站信息核验单南充二手房最新出售信息
  • 开发 网站 团队建设摩托车官网官方网站
  • 易经风水传承者【谷晟阳】
  • 自己做培训需要网站吗甘肃建设厅网站注入
  • 网站自行备案成都附近旅游景区哪里好玩
  • wordpress 注册登陆插件外贸seo是什么意思啊
  • 网站开发调查问卷电影片头在线制作网站
  • 网站制作公司小邓管理咨询公司工作简报
  • 做一个网站多长时间专门做悬疑推理小说的阅读网站
  • 网站图片像素多少上海优化网站
  • 江苏海通建设有限公司网站广西网络广播电视台直播
  • AI基础概念-第一部分:核心名词与定义(二)
  • 无锡哪里做网站好网站开发技术的背景
  • 昌平电子网站建设怎么做英文的网站首页
  • AI大模型低成本使用攻略:阿波罗AI+Cherry Studio
  • 建筑设计网上课程哈尔滨seo优化服务商
  • 个人网站建设方案书使用几号纸wordpress建站环境搭建
  • 公司网站上传不了图片网页设计图片间距代码
  • TDengine 数学函数 CRC32 用户手册
  • 【LLM-Agent】七种agent协作模式
  • 买网站需要注意什么html5网页设计与实现
  • 公司如何建站住建部网站建设部
  • 资料分析-比重
  • 网站建设代理开发科技企业服务拉新项目官方一手平台
  • 网站被清空了怎么办我被朋友拉进彩票网站说做代理
  • 如何给网站做外部优化怎么建立一个网站网址
  • 可以做请柬的网站成都网站seo排名优化
  • 内部网站建设app百度点击快速排名
  • 郑州网站做网站外贸网站营销建站