操作目的:1、實現Win7上圖形化遠程 CentOS
2、實現Win7與CentOS數據傳輸
1、實現Win7上圖形化遠程 CentOS
第一步:檢測CentOS上是否已安裝vnc-server
[root@Linux ~]# rpm -qa|grep vnc
tigervnc-server-1.1.0-5.el6_4.1.i686
tigervnc-1.1.0-5.el6_4.1.i686
tigervnc-server-module-1.1.0-5.el6_4.1.i686
因為已經裝好 所以顯示以上三個包,如未安裝則按以下命令安裝:
[root@Linux ~]# yum install tigervnc-server.i686 tigervnc.i686
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* base: mirrors.grandcloud.cn
* extras: mirrors.grandcloud.cn
* rpmforge: ftp.riken.jp
* updates: mirrors.grandcloud.cn
Setting up Install Process
Package tigervnc-server-1.1.0-5.el6_4.1.i686 already installed and latest version
Package tigervnc-1.1.0-5.el6_4.1.i686 already installed and latest version
Nothing to do
第二步:配置VNC
[root@Linux ~]# vim /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="1:chen 2:root"
VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
其中
VNCSERVERS="1:chen 2:root"
格式為 (桌面號:用戶) 可以加多個
第三步、設置vnc鏈接密碼
[root@Linux ~]# vncpasswd
第四步、重啟vncserver
[root@Linux ~]# service vncserver restart
Shutting down VNC server: 1:chen 2:root [ OK ]
Starting VNC server: 1:chen
New 'Linux:1 (chen)' desktop is Linux:1
Starting applications specified in /home/chen/.vnc/xstartup
Log file is /home/chen/.vnc/Linux:1.log
2:root
New 'Linux:2 (root)' desktop is Linux:2
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/Linux:2.log
[ OK ]
第五步、要麼設置防火牆規則 ,要麼關閉防火牆
[root@Linux ~]# service iptables stop
第六步、在win7 下載 VNC-Viewer
下載好運行並輸入 ip:桌面號 eg: 192.168.0.6:1 接著提示輸入密碼 OK。
至此已經可以實現win7下圖形界面訪問CentOs 桌面。
2、實現Win7與CentOS數據傳輸
用的時SSH Secure File Transfer Client
打開 並輸入 : Host Name : 192.168.0.6
User Name :Your name
點擊鏈接 提示輸入密碼 OK
至此 文章開始的兩個功能都已實現!