Linux學習一——vnc遠程學習 vnc安裝 Shell代碼 [root@SC-026 ~]# yum install vnc www.2cto.com vnc遠端連線 首先ssh登入到遠程機器上,用命令vncserver為目前使用者開放一個連接埠 退出後,在利用命令vncviewer串連到遠程機器上,就可以進行各種操作。 Shell代碼 [root@SC-026 ~]# ssh 192.168.15.182 root@192.168.15.182's password: Last login: Sat Oct 27 00:30:02 2012 from sfserver20.localdomain 遠程機器開連接埠 Shell代碼 [root@sfserver20 ~]# vncserver -geometry 1600x900 :3 New 'sfserver20.localdomain:3 (root)' desktop is sfserver20.localdomain:3 Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/sfserver20.localdomain:3.log www.2cto.com 關閉連接埠 Shell代碼 [root@sfserver20 ~]# vncserver -kill :3 Killing Xvnc process ID 29665 如果登入想看到案頭形式,需要修改一下檔案 Shell代碼 [root@sfserver20 ~]# vim .vnc/xstartup 最後一行注釋掉,再新增加一行如下: #twm & //注釋掉 gnome-session & //表示遠端使用者登入Linux的GNOME案頭 或startkde & //表示遠端使用者登入Linux的KDE案頭,不如上一次效果好 www.2cto.com 退出,從連接埠進入: Shell代碼 [root@sfserver20 ~]# exit [root@SC-026 ~]# vncviewer 192.168.15.182:3 VNC Viewer Free Edition 4.1.2 for X - built Jul 27 2010 10:24:13 Copyright (C) 2002-2005 RealVNC Ltd. See http://www.realvnc.com for information on VNC. Thu Nov 1 15:54:10 2012 CConn: connected to host 192.168.15.182 port 5903 CConnection: Server supports RFB protocol version 3.8 CConnection: Using RFB protocol version 3.8 出現以下介面,輸入密碼即可以案頭形式登陸到遠程機器上。