溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Linux系統(tǒng)安裝VNC的過程

發(fā)布時間:2021-09-10 18:16:41 來源:億速云 閱讀:122 作者:chen 欄目:建站服務(wù)器

這篇文章主要介紹“Linux系統(tǒng)安裝VNC的過程”,在日常操作中,相信很多人在Linux系統(tǒng)安裝VNC的過程問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”Linux系統(tǒng)安裝VNC的過程”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!

一、安裝tigervnc-server VNC軟件包
[root@localhost ~]# yum install tigervnc-server ###沒有配置yum源可以使用 rpm -ivh安裝
[root@localhost ~]# rpm -qc tigervnc-server
/etc/sysconfig/vncservers
[root@localhost ~]# chkconfig --level 35 vncserver on
二、目的:以root用戶啟動
[root@localhost ~]# vim /etc/sysconfig/vncservers
VNCSERVERS="1:root"
以vnc使用用戶登錄系統(tǒng),創(chuàng)建vnc密碼,vncpasswd
[root@localhost ~]$ vncpasswd
Password: 輸入密碼
Password must be at least 6 characters - try again
Password: 再次輸入密碼
Verify:

啟動服務(wù)一次,生成 /home/visitor/.vnc/xstartup

[root@localhost ~]$ vncserver
New 'localhost.localdomain:1 (visitor)' desktop is localhost.localdomain:1
Starting applications specified in /home/visitor/.vnc/xstartup
Log file is /home/visitor/.vnc/localhost.localdomain:1.log
三,啟動服務(wù)
[root@localhost ~]# /etc/init.d/vncserver start
正在啟動 VNC 服務(wù)器:1:root
New 'localhost.localdomain:1 (visitor)' desktop is localhost.localdomain:1
Starting applications specified in /home/visitor/.vnc/xstartup
Log file is /home/student/.vnc/localhost.localdomain:2.log
[確定]
四.添加防火墻配置
[root@localhost ~]# vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT
[root@localhost ~]# service iptables restart
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: [ OK ]

PS: 有時因為網(wǎng)絡(luò)安全要求,不能使用常用端口,需要更改vnc服務(wù)的默認端口,按照以下步驟即可: 

1。修改vnc的默認端口
[root@localhost ~]# vim /usr/bin/vncserver
注釋:修改如下兩行中默認的端口5900為你想要修改的端口 118:$vncPort = 5900 + $displayNumber;
274: if (!bind(S, pack(‘S n x12’, $AF_INET, 5900 + $n))) {
2.重啟vnc服務(wù) [root@localhost ~]# /etc/init.d/vncserver restar
3.訪問vnc時,比如使用VNC viewer訪問,你訪問的端口比如是:
192.168.2.11:9701 而你在/etc/sysconfig/vncserver中配置的桌面端口是 1:root 那么在第1步中配置文件中修改的端口號就應(yīng)該是 9701-1=9700

到此,關(guān)于“Linux系統(tǒng)安裝VNC的過程”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注億速云網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>

向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI