CentOS 下 VNC Server 的配置与使用
来源:互联网 发布:集贤第一中学网络空间 编辑:程序博客网 时间:2024/06/16 10:44
1.安装 VNC
yum install vnc vnc-server
系统会提示你确认一些选项,输入 "Y" 确认。
首次设置VNC密码 XXXXX 重复输入两次即可。
错误解决1
安装过程中课程出现错误:
- [dix] Could not init font path element /usr/share/X11/fonts/misc, removing from list!
- [dix] Could not init font path element /usr/share/X11/fonts/Type1, removing from list!
- [dix] Could not init font path element /usr/share/fonts/default/Type1, removing from list!
- [dix] Could not init font path element built-ins, removing from list! Fatal server error:
- could not open default font 'fixed'
- yum install libXfont xorg-x11-xinit xorg-x11-fonts-Type1
错误解决2
安装过程中课程出现错误:
- -bash vncserver: command not found
解决方法:
- yum install tightvnc-server
2.配置桌面
vi ~/.vnc/xstartup
主要修改最后两行。改为:
- # xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
- # twm &
- gnome-session &
保存该文件即可。
3.配置登录帐号
vi /etc/sysconfig/vncservers
出现如下提示:
# The VNCSERVERS variable is a list of display:user pairs.
- #
- # Uncomment the lines below to start a VNC server on display :2
- # as my 'myusername' (adjust this to your own). You will also
- # need to set a VNC password; run 'man vncpasswd' to see how
- # to do that.
- #
- # DO NOT RUN THIS SERVICE if your local area network is
- # untrusted! For a secure way of using VNC, see this URL:
- # http://kbase.redhat.com/faq/docs/DOC-7028
- # Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
- # Use "-localhost" to prevent remote VNC clients connecting except when
- # doing so through a secure tunnel. See the "-via" option in the
- # `man vncviewer' manual page.
- # VNCSERVERS="2:myusername"
- # VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
![](http://static.blog.csdn.net/images/save_snippets.png)
编辑最后两行,将这两行注释去掉,得到:
- VNCSERVERS="1:root"
- VNCSERVERARGS[1]="-geometry 1024x768"
如果你有多个帐号,则按照下面格式配置。
- VNCSERVERS="1:user1 2:user2 3:user3"
- VNCSERVERARGS[1]="-geometry 1024×768"
- VNCSERVERARGS[2]="-geometry 1024×768"
- VNCSERVERARGS[3]="-geometry 800×600 -depth 24 -nolisten tcp -nohttpd -localhost" #不支持 tcp,不支持 http 连接,只能在本地测试访问。
如果使用user2,需要对user2用户执行如下操作
- [root@<span style="background-color: rgb(240, 240, 240);">localhost </span>~]#su user2
- [test@<span style="background-color: rgb(240, 240, 240);">localhost </span>~]$mkdir .vnc //*创建.vnc目录,用于保存此用户的vnc配置文件*//
- [test@<span style="background-color: rgb(240, 240, 240);">localhost </span>~]$vncpasswd //*设置user2用户的vnc远程连接密码*//
- [test@<span style="background-color: rgb(240, 240, 240);">localhost </span>~]$su root
- [root@<span style="background-color: rgb(240, 240, 240);">localhost </span>~]#service vncserver restart
4.配置防火墙,系统服务
VNC server 监听的端口从 5900 开始,display:1 的监听 5901,display:2 监听 5902,以此类推。CentOS 的防火墙缺省是不允许连接这些端口的,所以需要使用下面的步骤打开防火墙:
vi /etc/sysconfig/iptables
上面我们只添加了一个 root 帐号和桌面 1,所以这里按照上面的规则,添加一个 "5901" 端口号即可。
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
设置 VNC 自动启动
chkconfig -level 345 vncserver on
0 0
- CentOS 下 VNC Server 的配置与使用
- CentOS 下 VNC Server 的配置与使用
- centos下的vnc server的使用
- CentOS下快速配置VNC Server
- CentOS 5.x下VNC Server配置
- CentOS 下VNC Server远程桌面配置详解
- CentOS下配置VNC
- centos vnc server配置方法
- centos vnc server配置方法
- CentOS Linux下VNC Server远程桌面配置详解
- (总结)CentOS Linux下VNC Server远程桌面配置详解
- CentOS Linux下VNC Server远程桌面配置详解
- CentOS Linux下VNC Server远程桌面配置详解
- CentOS Linux下VNC Server远程桌面配置详解
- (总结)CentOS Linux下VNC Server远程桌面配置详解
- (总结)CentOS Linux下VNC Server远程桌面配置详解
- (总结)CentOS Linux下VNC Server远程桌面配置详解
- CentOS Linux下VNC Server远程桌面配置详解
- css/css3总结(二)属性
- Liunx 学习之chmod,chown,chgrp命令
- javascript基础:String对象
- LitePal使用遇到的坑
- 按要求输出
- CentOS 下 VNC Server 的配置与使用
- 希腊字母发音对照表
- Android 热加载 插件化 模块化集成
- 初学linux
- 叠筐
- STM32 F1配置外部晶振
- C# 中的转意字符
- 年轻程序员需要学习的5大经验
- JAVA之输出斐波那契数列的前10个数