Centos 6系统搭建tigervnc-server实现多用户访问 1.CentOS 安装tigervncserver [root@vnc ~]# rpm -qa |grep tigervnc 2.配置vncservers,假设你有两个用户想要远程登录,用户名分别是user1,user2 [root@vnc ~]# vim /etc/sysconf/vncservers 在这个文件末添加 VNCSERVERS="1:user1 2:user2" VNCSERVERARGS[1]="-geometry 1440x900" VNCSERVERARGS[2]="-geometry 1440x900" 如果你还有更多用户想远程登录,就得在VNCSERVERS这一行中继续添加3:user3等等,下面的VNCSERVERARGS[i]是对应第 i个用户远程登录的参数。这个参数还有好多选项,我也不大清楚用处,所以我就设置了一下分辨率,你可以根据自己的需要将1440x900改成你想要的分辨率 【CentOS 6系统搭建TigerVNC-Server实现多用户访问】 在远程管理Linux系统时,TigerVNC Server是一种流行的解决方案,尤其在CentOS 6这样的旧版系统上。TigerVNC是一个轻量级、高效且跨平台的远程桌面协议(RDP)实现,允许用户通过图形界面远程访问Linux桌面。以下是如何在CentOS 6上配置TigerVNC Server以支持多用户访问的详细步骤: 1. **安装TigerVNC Server** 在开始之前,确保系统是最新的。然后,可以通过执行以下命令来安装TigerVNC Server: ```bash [root@vnc ~]# yum update [root@vnc ~]# yum install tigervnc-server ``` 2. **配置VNC Servers** 配置多用户访问的关键在于编辑`/etc/sysconfig/vncservers`文件。打开文件并添加用户信息,如下所示: ``` [root@vnc ~]# vim /etc/sysconfig/vncservers ``` 在文件末尾添加每个多用户条目,例如: ``` VNCSERVERS="1:user1 2:user2" VNCSERVERARGS[1]="-geometry 1440x900" VNCSERVERARGS[2]="-geometry 1440x900" ``` `VNCSERVERS`中的数字代表桌面编号,`user1`和`user2`是用户账号。`VNCSERVERARGS`后面的参数用于指定每个用户桌面的分辨率。 3. **生成xstartup和设置vncpasswd** 每个用户都需要设置VNC密码。切换到相应用户并执行`vncpasswd`命令: ``` [root@vnc ~]# su - user1 [user1@vnc ~]$ vncpasswd [user1@vnc ~]$ vncserver :1 ``` 重复以上步骤为其他用户设置密码和启动VNC Server。启动VNC Server时会自动生成`~/.vnc/xstartup`文件,用于指定启动时加载的应用程序。 4. **启动和停止VNC Server** 启动VNC Server,可以使用用户模式或root模式: - 用户模式:`[user1@vnc ~]$ vncserver :1` - Root模式:`[root@vnc ~]# service vncserver start` 停止VNC Server有多种方式: - 用户模式:`[user1@vnc ~]$ vncserver -kill :1` - Root模式:`[root@vnc ~]# vncserver -kill :1` - 服务模式:`[root@vnc ~]# service vncserver stop` - 进程杀除:`[root@vnc ~]# ps -ef | grep vnc && kill -9 进程号` 5. **定制xstartup文件** 如果需要自定义启动时的桌面环境或应用,可以编辑`~/.vnc/xstartup`文件。默认情况下,它可能为空或包含基本的X窗口管理器启动命令。例如,可以使用GNOME: ```bash [root@vnc ~]# vim /home/user1/.vnc/xstartup ``` 并添加以下内容: ``` #!/bin/sh xrdb $HOME/.Xresources startx /usr/bin/gnome-session & ``` 保存并使更改生效,需要重启VNC Server。 6. **防火墙配置** 要允许外部访问,必须配置防火墙。在CentOS 6上,可以使用`iptables`打开VNC端口(通常为5900+n,n是桌面编号): ``` [root@vnc ~]# iptables -A INPUT -p tcp --dport 5901 -j ACCEPT [root@vnc ~]# iptables -A INPUT -p tcp --dport 5902 -j ACCEPT [root@vnc ~]# service iptables save [root@vnc ~]# service iptables restart ``` 7. **远程连接** 用户可以从任何VNC客户端(如RealVNC或TightVNC)连接到服务器,使用相应的IP地址和桌面编号,以及之前设置的VNC密码。 完成上述步骤后,CentOS 6系统上的TigerVNC Server就配置好了,可以支持多个用户同时远程访问各自的桌面环境。请注意,由于这是一个较旧的操作系统版本,某些软件包可能不再维护,因此推荐在更新的系统上使用更现代的远程桌面解决方案,如X2Go或NoMachine。
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rpm](https://img-home.csdnimg.cn/images/20250102104920.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![doc](https://img-home.csdnimg.cn/images/20241231044833.png)
![rpm](https://img-home.csdnimg.cn/images/20250102104920.png)
![thumb](https://img-home.csdnimg.cn/images/20250102104920.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rpm](https://img-home.csdnimg.cn/images/20250102104920.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rpm](https://img-home.csdnimg.cn/images/20250102104920.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rpm](https://img-home.csdnimg.cn/images/20250102104920.png)
![rpm](https://img-home.csdnimg.cn/images/20250102104920.png)
![rpm](https://img-home.csdnimg.cn/images/20250102104920.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rpm](https://img-home.csdnimg.cn/images/20250102104920.png)
![](https://csdnimg.cn/release/download_crawler_static/8076545/bg1.jpg)
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/0454fb1214d7431e86a1a3888908627c_mse2002_cjh.jpg!1)
- 粉丝: 0
- 资源: 1
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
- 单相Boost PFC双闭环控制仿真模型:高精度功率因数与详细数据测量注释,单相Boost PFC双闭环控制仿真模型:高功率因数0.9995下的电压外环PI与电感电流滞环控制,详细数据测量及模块注释
- 基于Vue框架的消防一体化系统设计源码
- 衢州市乡镇边界,shp格式
- hotgo-移动应用开发资源
- unisrc-单片机开发资源
- 固态继电器电路.zip
- 光控照明灯自动开关.zip
- 光控式道路施工闪烁警示灯控制电路.zip
- 光电传感器与应用电路.zip
- 安川伺服电机与S7-200SMART PLC及MCGS7.7触摸屏联机程序例程:含CAD图纸、参数详解及运行效果视频说明书,安川伺服电机与西门子S7-200SMART PLC及MCGS7.7触摸屏联机
- 红外测量控器的发射与接收.zip
- 红外探测自动开关.zip
- 红外线集成器件sNS9201在延时开关中的应用.zip
- 霍尔传感器与应用电路.zip
- 继电器电路.zip
- 家用彩色幻灯电路.zip
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)