{"id":116,"date":"2018-10-21T15:46:25","date_gmt":"2018-10-21T07:46:25","guid":{"rendered":"http:\/\/www.eait.co\/?p=116"},"modified":"2018-11-02T02:40:19","modified_gmt":"2018-11-01T18:40:19","slug":"centos%e5%ae%89%e8%a3%85vnc%e7%95%8c%e9%9d%a2","status":"publish","type":"post","link":"https:\/\/notes.coremix.net\/?p=116","title":{"rendered":"centos\u5b89\u88c5vnc\u754c\u9762"},"content":{"rendered":"<p>VNC\u662fLinux\u4e0a\u7684\u4e00\u6b3e\u975e\u5e38\u4f18\u79c0\u7684\u8fdc\u7a0b\u63a7\u5236\u5de5\u5177\u8f6f\u4ef6\uff0c\u901a\u5e38\u6211\u4eec\u5728Windows\u4e0a\u9762\u5b89\u88c5vnc\u5ba2\u6237\u7aef\u8f6f\u4ef6\u6765\u8fdc\u7a0b\u8bbf\u95eeLinux\u673a\u5668(Windows\u4e0a\u5e38\u7528\u7684\u5ba2\u6237\u7aefRealVNC)\uff0c\u8981\u8fdc\u7a0b\u8fde\u63a5\u5230Linux\u9996\u5148\u8981\u786e\u4fddLinux\u4e0a\u9762\u5df2\u7ecf\u5b89\u88c5\u4e86VNC server\uff0c\u4e0b\u9762\u4ee5CentOS 6\u4e3a\u4f8b\u6765\u8bf4\u660e\uff1a<\/p>\n<p><strong>1. \u68c0\u67e5\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\u4e86VNC server<\/strong><\/p>\n<div class=\"cnblogs_code\">\n<pre>[root@centos6 ~]# rpm -qa | grep vnc\r\ntigervnc-1.0.90-0.17.20110314svn4359.el6.i686\r\ngtk-vnc-0.3.10-3.el6.i686\r\ntigervnc-server-1.0.90-0.17.20110314svn4359.el6.i686\r\ngtk-vnc-python-0.3.10-3.el6.i686<\/pre>\n<\/div>\n<p>\u5982\u679c\u4e0a\u9762\u7684\u51e0\u4e2arpm\u5305\u5df2\u7ecf\u5b58\u5728\uff0c\u8bf4\u660eVNC server\u5df2\u7ecf\u5b89\u88c5\u597d\u4e86\uff0c\u63a5\u4e0b\u6765\u8df3\u8f6c\u6b65\u9aa43\u542f\u52a8vncserver\u5c31\u53ef\u4ee5\u4e86\uff0c\u5426\u5219\u6267\u884c\u6b65\u9aa42<\/p>\n<p><strong>2. \u5b89\u88c5VNC server<\/strong><\/p>\n<div class=\"cnblogs_code\">\n<pre># yum install tigervnc\r\n# yum install tigervnc-server<\/pre>\n<\/div>\n<p><strong>3. \u542f\u52a8vncserver<\/strong><\/p>\n<p>\u7b2c\u4e00\u6b21\u542f\u52a8vncserver\u9700\u8981\u8f93\u5165\u5bc6\u7801\u4e24\u6b21<\/p>\n<div class=\"cnblogs_code\">\n<div class=\"cnblogs_code_toolbar\"><span class=\"cnblogs_code_copy\"><a title=\"\u590d\u5236\u4ee3\u7801\"><img decoding=\"async\" src=\"https:\/\/common.cnblogs.com\/images\/copycode.gif\" alt=\"\u590d\u5236\u4ee3\u7801\" \/><\/a><\/span><\/div>\n<pre>[root@centos6 mnt]# vncserver\r\n\r\nYou will require a password to access your desktops.\r\n\r\nPassword:\r\nVerify:\r\n\r\nNew 'centos6.xman.org:1 (root)' desktop is centos6.xman.org:1\r\n\r\nCreating default startup script \/root\/.vnc\/xstartup\r\nStarting applications specified in \/root\/.vnc\/xstartup\r\nLog file is \/root\/.vnc\/centos6.xman.org:1.log<\/pre>\n<div class=\"cnblogs_code_toolbar\"><span class=\"cnblogs_code_copy\"><a title=\"\u590d\u5236\u4ee3\u7801\"><img decoding=\"async\" src=\"https:\/\/common.cnblogs.com\/images\/copycode.gif\" alt=\"\u590d\u5236\u4ee3\u7801\" \/><\/a><\/span><\/div>\n<\/div>\n<p>\u53ef\u4ee5\u770b\u5230\u5df2\u7ecf\u751f\u6210\u4e86\u4e00\u4e2adesktop\uff1acentos6.xman.org:1<\/p>\n<p>\u4e3a\u4e86\u65b9\u4fbf\uff0c\u53ef\u89c1\u5c06vncserver\u6dfb\u52a0\u5230\u5f00\u673a\u542f\u52a8\u7684\u670d\u52a1\u4e2d\uff0c\u4f7f\u7528setup-&gt;System services, \u9009\u62e9vncserver\u4fdd\u5b58\u5373\u53ef<\/p>\n<p>\u63a5\u4e0b\u6765\u5728VNC\u5ba2\u6237\u7aef\u8f93\u5165\u4e0a\u9762\u7684desktop\u5c31\u53ef\u4ee5\u8fde\u63a5\u4e0aLinux\u7684desktop\uff0c\u5982\u679c\u53d1\u73b0\u8fde\u63a5\u4e0d\u4e0a\uff0c\u6709\u53ef\u80fd\u662f\u4e0b\u9762\u4e24\u4e2a\u539f\u56e0\u5bfc\u81f4\u7684\uff1a<\/p>\n<p>(1) \u672c\u5730windows\u7684hosts\u6587\u4ef6\u4e2d\u6ca1\u6709\u914d\u7f6e\u8fdc\u7a0bLinux\u7684hostname\uff0c\u89e3\u51b3\u65b9\u6848\u4e5f\u5f88\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5c06desktop\u7684hostname\u66ff\u6362\u4e3aIP\u5730\u5740\u6216\u8005\u5728\u672c\u5730windows\u7684hosts\u6587\u4ef6\u4e2d\u6dfb\u52a0\u76f8\u5e94\u7684hostname\u4e0eIP\u7684\u6620\u5c04\u5173\u7cfb\u5373\u53ef<\/p>\n<p>(2) \u662f\u7531\u4e8eLinux\u7684\u9632\u706b\u5899\u963b\u6b62\u4e86\uff0c\u8fd9\u65f6\u6211\u4eec\u53ef\u4ee5\u9009\u62e9\u5173\u95ed\u9632\u706b\u5899\u6216\u8005\u5c06VNC\u7684\u670d\u52a1\u7aef\u53e3\u52a0\u5165\u5230Linux\u9632\u706b\u5899\u7684\u4fe1\u4efb\u5217\u8868<\/p>\n<div class=\"cnblogs_code\">\n<pre>#\u5173\u95ed\u9632\u706b\u5899\r\n# \/sbin\/service ipstables stop<\/pre>\n<\/div>\n<p>\u5982\u4f55\u5c06VNC server\u6dfb\u52a0\u5230Linux\u7684\u9632\u706b\u5899\u4fe1\u4efb\u5217\u8868\uff0c\u53ef\u4ee5\u53c2\u89c1Linux\u9632\u706b\u5899\u7b56\u7565\u914d\u7f6e\u3002<\/p>\n<p>\u4e3a\u4e86\u7cfb\u7edf\u7684\u5b89\u5168\u6027\u8003\u8651\uff0c\u6700\u597d\u4e0d\u8981\u5173\u95ed\u9632\u706b\u5899\uff0c\u6211\u4eec\u53ef\u4ee5\u628avnc\u7684\u8bbf\u95ee\u7aef\u53e3\u914d\u7f6e\u5728\/etc\/sysconfig\/iptablest\u7684\u884c\u4eba\u5217\u8868\u4e2d<\/p>\n<p>&nbsp;<\/p>\n<div class=\"cnblogs_code\">\n<pre>[root@centos6u2 ~]# vim \/etc\/sysconfig\/iptables\r\n# then add below line to this file\r\n-A INPUT -m state --state NEW -m tcp -p tcp --dport 5900:5910 -j ACCEPT\r\n\r\n# restart iptables\r\n[root@centos6u2 ~]# service iptables restart<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>VNC\u662fLinux\u4e0a\u7684\u4e00\u6b3e\u975e\u5e38\u4f18\u79c0\u7684\u8fdc\u7a0b\u63a7\u5236\u5de5\u5177\u8f6f\u4ef6\uff0c\u901a\u5e38\u6211\u4eec\u5728Windows\u4e0a\u9762\u5b89\u88c5vnc\u5ba2\u6237\u7aef\u8f6f\u4ef6\u6765\u8fdc\u7a0b\u8bbf [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,2],"tags":[],"class_list":["post-116","post","type-post","status-publish","format-standard","hentry","category-other","category-index"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=116"}],"version-history":[{"count":1,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/116\/revisions"}],"predecessor-version":[{"id":117,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/116\/revisions\/117"}],"wp:attachment":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}