liunxssh與vncview安全"行"

來源:互聯網
上載者:User

liunxssh與vncview安全"行"

SSH 為 Secure Shell 的縮寫,由 IETF 的網路工作小組(Network Working Group)所制定;SSH 為建立在應用程式層和傳輸層基礎上的安全性通訊協定。SSH 是目前較可靠,專為遠程登入工作階段和其他網路服務提供安全性的協議。利用 SSH 協議可以有效防止遠端管理過程中的資訊泄露問題。

VNC (Virtual Network Computer)是虛擬網路電腦的縮寫。VNC 是一款優秀的遠端控制工具軟體,由著名的 AT&T 的歐洲研究實驗室開發的。VNC 是在基於 UNIX 和 Linux 作業系統的免費的開源軟體,遠端控制能力強大,高效實用,其效能可以和Windows 和 MAC 中的任何遠端控制軟體媲美。 在 Linux 中,VNC 包括以下四個命令:vncserver,vncviewer,vncpasswd,和 vncconnect。大多數情況下使用者只需要其中的兩個命令:vncserver 和 vncviewer。但是VNC 是明文的,不安全的.串連過程可能會被竊聽,幹擾.可以使用SSH通道加密,然後再由遠程主機的迴環地址通訊,加大了安全性。

下面就給大家示範一個ssh配合vncview訪問的例子。下面就給大家示範一個ssh配合vncview訪問的例子。這個例子適合redhat|Centos|OEL6以上本,redhat|Centos|OEL5配置不一樣。

1.服務端設定(192.168.1.102) 1.1 安裝vnc
[root@cent2 ~]# yum -y install tigervnc tigervnc-serverLoaded plugins: fastestmirror, refresh-packagekit, security…………………..…………………Complete![root@cent2 ~]# rpm -qa tigervnctigervnc-1.1.0-8.el6_5.x86_64[root@cent2 ~]#
1.2 修改參數檔案
[root@cent2 ~]# 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:# 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="2:myusername"# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"VNCSERVERS="1:oracle 2:grid"VNCSERVERARGS[1]="-geometry 1024x768 -nolisten tcp"VNCSERVERARGS[2]="-geometry 1024x768 -nolisten tcp -SecurityTypes None"[root@cent2 ~]#
主要添加了2個vnc使用者,oracle使用者和grid使用者,VNCSERVERARGS[1]表示oracle使用者解析度和協議。但是VNCSERVERARGS[2]代表的grid使用者不用輸入密碼就可以串連。 1.3 為使用者設計vnc密碼
[root@cent2 ~]# su - oracle[oracle@cent2 ~]$ [oracle@cent2 ~]$ vncpasswdPassword:Verify:[oracle@cent2 ~]$ [oracle@cent2 ~]$ exitlogout[root@cent2 ~]# [root@cent2 ~]# su - grid[grid@cent2 ~]$ [grid@cent2 ~]$ vncpasswdPassword:Verify:[grid@cent2 ~]$
這樣做的好處,就是系統使用者密碼和vnc使用者密碼分開。 1.4 啟動vnc
[root@cent2 ~]# service vncserver startStarting VNC server: 1:oracle xauth:  creating new authority file /home/oracle/.XauthorityNew 'cent2:1 (oracle)' desktop is cent2:1Creating default startup script /home/oracle/.vnc/xstartupStarting applications specified in /home/oracle/.vnc/xstartupLog file is /home/oracle/.vnc/cent2:1.log2:grid xauth:  creating new authority file /home/grid/.XauthorityNew 'cent2:2 (grid)' desktop is cent2:2Creating default startup script /home/grid/.vnc/xstartupStarting applications specified in /home/grid/.vnc/xstartupLog file is /home/grid/.vnc/cent2:2.log[  OK  ][root@cent2 ~]#
1.5 測試
如果要串連Z喎?http://www.bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcmFjbGXTw7uno6zEx77Nysc1OTAxwcuho9Xisd/Wu8rHsuLK1M/Co6x0aWdlcnZuY8rHt/HF5NbDusOho8/Cw+ayxcrHxeTWw3NzaLe9yr21xMGsvdOhowogICAKPGgxPiAyLr/Nu6e2y8no1sOjqDE5Mi4xNjguMS4xMDOjqTwvaDE+CjxoMj4gIDIuMSB3aW5kb3e/zbuntss8L2gyPgogICB3aW5kb3e/zbuntsvR6dakt73KvaOsztLDx9PDtcS5pL7fysdDUlQKPGltZyBzcmM9"http://www.2cto.com/uploadfile/Collfiles/20140909/20140909090917109.png" width="700" alt="\">
如果圖片,右鍵直接開啟圖片的URL好了,分比率挺大的圖片。 通過上面的設定,就把伺服器的5901連接埠映射到本地的5901了,在用vnc工具的時候,就要串連本地了。
大家看到了沒有,這裡串連的就是本地的127.0.0.1:5901了。 2.2 liunx用戶端 利用ssh 映射服務端(192.168.1.102)的5901連接埠 到 本地的5901連接埠
[root@cent1 Desktop]# ssh -L 5901:localhost:5901 192.168.1.102The authenticity of host '192.168.1.102 (192.168.1.102)' can't be established.RSA key fingerprint is ea:d9:cd:1e:5a:51:79:07:19:d2:e3:50:99:3f:35:a6.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '192.168.1.102' (RSA) to the list of known hosts.Address 192.168.1.102 maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!root@192.168.1.102's password: Last login: Sun Sep  7 18:55:25 2014 from 192.168.1.101[root@cent2 ~]#
開啟vncviewer
root@cent1 Desktop]# vncviewer 127.0.0.1:5901TigerVNC Viewer for X version 1.1.0 - built Feb  4 2014 05:24:41Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)See http://www.tigervnc.org for information on TigerVNC.Sun Sep  7 11:24:11 2014 CConn:       connected to host 127.0.0.1 port 5901 CConnection: Server supports RFB protocol version 3.8 CConnection: Using RFB protocol version 3.8Sun Sep  7 11:24:17 2014 TXImage:     Using default colormap and visual, TrueColor, depth 24. CConn:       Using pixel format depth 24 (32bpp) little-endian rgb888 CConn:       Using Tight encoding

這樣就配置好了,可以在liunx裡面登陸了。


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.