博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
远程桌面连接centos 7
阅读量:5033 次
发布时间:2019-06-12

本文共 1849 字,大约阅读时间需要 6 分钟。

首先安装tigervnc-server:

yum install tigervnc-server

 

安装好后,设置 vi /etc/sysconfig/vncservers

[root@gateway-001 ~]# cat /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:# https://access.redhat.com/knowledge/solutions/7027# 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="1:root"VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"VNCSERVERS="2:work"VNCSERVERARGS[2]="-geometry 1024x768  -nolisten tcp -localhost"

 

 

启动vncserver服务器:

[root@gateway-001 ~]# service vncserver start

切换到work用户,设置vncpasswd

在服务器上可以看到打开的vnc端口:

 

 

 

在windows上安装viewvnc,输入ip地址和端口号进行连接:

 

输入密码:

可以看到成功的连接上了centos 6.5的桌面:

 

 

 

/etc/sysconfig/iptables

# Firewall configuration written by system-config-firewall# Manual customization of this file is not recommended.*filter:INPUT ACCEPT [0:0]:FORWARD ACCEPT [0:0]:OUTPUT ACCEPT [0:0]-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT-A INPUT -m state --state NEW -m tcp -p tcp --dport 6000:6010 -j ACCEPT-A INPUT -m state --state NEW -m udp -p udp --dport 177 -j ACCEPT-A INPUT -p icmp -j ACCEPT-A INPUT -i lo -j ACCEPT-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT-A INPUT -j REJECT --reject-with icmp-host-prohibited-A FORWARD -j REJECT --reject-with icmp-host-prohibitedCOMMIT

关闭防火墙: /etc/init.d/iptables stop 使用root账号

转载于:https://www.cnblogs.com/endv/p/6427169.html

你可能感兴趣的文章
asp.net json,对象,字符串的相互转换
查看>>
Oracle优化面试题
查看>>
Spring入门之二-------SpringIoC之实例化Bean以及注入Bean
查看>>
Centos6和7的区别
查看>>
338. Counting Bits
查看>>
MySQL临时表
查看>>
关于使用jqmobi前端框架在phonegap平台上开发时的日期时间选择控件
查看>>
HDU 4638 Group (莫队算法||线段树离散查询)
查看>>
精神到处文章老,学问深时意气平(努力方向)——Leo2014年终总结
查看>>
Android-ListView 下拉刷新
查看>>
批量判断流量大于300的小脚本
查看>>
SDN
查看>>
cf 11B Jumping Jack(贪心,数学证明一下,,)
查看>>
POJ 2418 Hardwood Species(STL在map应用)
查看>>
Python开发之路
查看>>
Codeforces 449.C Jzzhu and Apples
查看>>
取石子游戏HDU1846
查看>>
前端常见英文缩写含义
查看>>
POJ_3967_Ideal Path
查看>>
将Ubuntu下网卡名称enss改为eth0
查看>>