VNCServer在Linux下设置
来源:互联网 发布:淘宝拍立得功能 编辑:程序博客网 时间:2024/06/06 02:59
1.检查vnc客户端和服务器是否已经安装:
[root@centos ~]$ rpm -q vnc-server
2. 将用户名称加入到配置文件:
(注:这里的“用户名”是指linux系统用户的名称)
[root@centos ~]# vi /etc/sysconfig/vncservers
#
# Uncomment the line below to start a VNC server on display :1
# 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
# .
#VNCSERVERS="1:myusername"//这段为原有内容
注:这里用到vi命令,按下Insert键就可以输入以下内容,输入完成后,按ESC键跳到命令模式然后,输入:w 保存文件:
# VNCSERVERS="1:root2:admin" # use the method for more user
VNCSERVERS="1:root 2:admin " //这句就是添加用户 可以添加多人
#VNCSERVERARGS[1]="-geometry800x600"
VNCSERVERARGS[1]="-geometry 1024x768" //这句应该是分辨率 可以不要
3. 设置用户root的密码
[root@centos ~]$ vncpasswd
Password:
Verify:
4. 启动VNC服务
[root@centos ~]# /sbin/service vncserver start
Starting VNC server: 1:root [ OK ]
5. 修改VNCSERVER的窗口治理器
[root@centos ~]#vi ~/.vnc/xstartup
#!/bin/sh
# Uncomment thefollowing two lines for normal desktop:
# unsetSESSION_MANAGER
# exec/etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ]&& exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ]&& xrdb $HOME/.Xresources
xsetroot -solidgrey
vncconfig -iconic&
xterm -geometry80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm& //这里加个# ,用于注释,加粗的为原有内容
gnome-session& //加上这行
#startkde #kdedesktop #如果是用kde去掉这行前面的注释号即可
6. 重启vncserver
[root@centos ~]#/sbin/service vncserver restart
Shutting down VNC server: 1:root[ OK ]
Starting VNC server: 1:root [ OK ]
7.查看VNC端口
[root@ centos ~]#netstat -ntlp
8.把防火墙端口打开
[root@centos ~]#vi /etc/sysconfig/iptables
找到以下的语句:
-A RH-Firewall-l-INPUT-j INPUT-j REJECT - reject-withicmp-host-prohibited
在此语句前面加上下面的内容:
[root@centos ~]#service iptables restart
10. Windows登陆到VNC Server
打开windows下的VNC客户端
在服务器栏输入
192.168.159.129:1 (这里,我的VNC服务器在192.168.159.129上,用的是Display1(对应root帐号))
加密:让服务器选择(默认)
[root@centos ~]$ rpm -q vnc-server
package vnc-server is not installed 说明没有安装
运行yum install vnc-server进行安装
vnc-server-4.0-8.1 说明安装已经安装了 只是没开启服务而已2. 将用户名称加入到配置文件:
(注:这里的“用户名”是指linux系统用户的名称)
[root@centos ~]# vi /etc/sysconfig/vncservers
#
# Uncomment the line below to start a VNC server on display :1
# 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
# .
#VNCSERVERS="1:myusername"//这段为原有内容
注:这里用到vi命令,按下Insert键就可以输入以下内容,输入完成后,按ESC键跳到命令模式然后,输入:w 保存文件:
# VNCSERVERS="1:root2:admin" # use the method for more user
VNCSERVERS="1:root 2:admin " //这句就是添加用户 可以添加多人
#VNCSERVERARGS[1]="-geometry800x600"
VNCSERVERARGS[1]="-geometry 1024x768" //这句应该是分辨率 可以不要
3. 设置用户root的密码
[root@centos ~]$ vncpasswd
Password:
Verify:
4. 启动VNC服务
[root@centos ~]# /sbin/service vncserver start
Starting VNC server: 1:root [ OK ]
5. 修改VNCSERVER的窗口治理器
[root@centos ~]#vi ~/.vnc/xstartup
#!/bin/sh
# Uncomment thefollowing two lines for normal desktop:
# unsetSESSION_MANAGER
# exec/etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ]&& exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ]&& xrdb $HOME/.Xresources
xsetroot -solidgrey
vncconfig -iconic&
xterm -geometry80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm& //这里加个# ,用于注释,加粗的为原有内容
gnome-session& //加上这行
#startkde #kdedesktop #如果是用kde去掉这行前面的注释号即可
6. 重启vncserver
[root@centos ~]#/sbin/service vncserver restart
Shutting down VNC server: 1:root[ OK ]
Starting VNC server: 1:root [ OK ]
7.查看VNC端口
[root@ centos ~]#netstat -ntlp
8.把防火墙端口打开
[root@centos ~]#vi /etc/sysconfig/iptables
找到以下的语句:
-A RH-Firewall-l-INPUT-j INPUT-j REJECT - reject-withicmp-host-prohibited
在此语句前面加上下面的内容:
-A Rh-Firewall-l-INPUT-m state -state NEW-mtcp-p tcp-dport 5901 -j ACCEPT //5901为查看到的VNC的端口号
VNC的默认端口是5900,而远程桌面连接端口则是5900+n(n是vncserver命令指定的)。如果使用“vncserver :1”命令启动VNC Server,那么下面的端口应该是5901。
[root@centos ~]#service iptables restart
10. Windows登陆到VNC Server
打开windows下的VNC客户端
在服务器栏输入
192.168.159.129:1 (这里,我的VNC服务器在192.168.159.129上,用的是Display1(对应root帐号))
加密:让服务器选择(默认)
- VNCServer在Linux下设置
- Ubuntu下设置VNCServer
- Ubuntu下设置VNCServer
- vncserver linux 下配置
- Linux下安装vncserver
- 在windows下访问linux图形界面之vncserver
- 在ubuntu下使用vncserver
- Linux下开启VNCserver服务
- Linux下开启VNCserver服务
- Linux下开启VNCserver服务
- Linux下怎样启动vncserver(HOWTO - Linux VNCserver)
- linux vncserver设置及配置自动启动
- 远程登陆vncserver在redhat下详细配置
- Linux下VNCSERVER的使用介绍
- Linux CentOS7 下安装配置vncserver
- centos linux 下VncServer 配置与 Win 下 Vnc 客户端
- linux下vncserver配置与win下vnc客户端
- Linux下VNCServer配置与win下的VNC客户端
- 修改FTP服务器端口后无法访问
- 20世纪有多少个星期日是当月的第一天?
- Datagridvew复选单元格实现多行删除
- java环境变量配置
- Uva - 1476 - Error Curves(三分)
- VNCServer在Linux下设置
- ThinkPHP目录结构
- ubuntu linux下笔记本禁用touch pad的方法
- Android中Fragment的应用
- POJ3041——Asteroids(二分图最大匹配)
- iOS学习笔记5-UIViewController(1)
- 图解 Git
- Q26、左旋转字符串(字符串)
- replace函数