深圳公司网站搭建公司,微信公众号如何快速涨粉,站群cms建站系统免费,江门刚刚发生的事情1.检查vnc客户端和服务器是否已经安装#xff1a; [rootcentos ~]$ rpm -q vnc-server
package vnc-server is not installed 说明没有安装
运行yum install vnc-server进行安装
vnc-server-4.0-8.1 说明安装已经安装了 只是没开启服务而已 2. 将用户名称加入到配置…1.检查vnc客户端和服务器是否已经安装 [rootcentos ~]$ rpm -q vnc-server
package vnc-server is not installed 说明没有安装
运行yum install vnc-server进行安装
vnc-server-4.0-8.1 说明安装已经安装了 只是没开启服务而已 2. 将用户名称加入到配置文件 (注这里的“用户名”是指linux系统用户的名称) [rootcentos ~]# 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 # . #VNCSERVERS1:myusername//这段为原有内容 注这里用到vi命令按下Insert键就可以输入以下内容输入完成后按ESC键跳到命令模式然后输入:w 保存文件 # VNCSERVERS1:root2:admin # use the method for more user VNCSERVERS1:root 2:admin //这句就是添加用户 可以添加多人 #VNCSERVERARGS[1]-geometry800x600 VNCSERVERARGS[1]-geometry 1024x768 //这句应该是分辨率 可以不要 3. 设置用户root的密码 [rootcentos ~]$ vncpasswd Password: Verify: 4. 启动VNC服务 [rootcentos ~]# /sbin/service vncserver start Starting VNC server: 1:root [ OK ] 5. 修改VNCSERVER的窗口治理器 [rootcentos ~]#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 -geometry80x241010 -ls -title $VNCDESKTOP Desktop #twm //这里加个# 用于注释加粗的为原有内容 gnome-session //加上这行 #startkde #kdedesktop #如果是用kde去掉这行前面的注释号即可 6. 重启vncserver [rootcentos ~]#/sbin/service vncserver restart Shutting down VNC server: 1:root[ OK ] Starting VNC server: 1:root [ OK ] 7.查看VNC端口 [root centos ~]#netstat -ntlp 8.把防火墙端口打开 [rootcentos ~]#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而远程桌面连接端口则是5900nn是vncserver命令指定的。如果使用“vncserver :1”命令启动VNC Server那么下面的端口应该是5901。
9.重启iptables服务 [rootcentos ~]#service iptables restart 10. Windows登陆到VNC Server 打开windows下的VNC客户端 在服务器栏输入 192.168.159.129:1 (这里我的VNC服务器在192.168.159.129上用的是Display1(对应root帐号)) 加密:让服务器选择(默认)