首页
/
每日頭條
/
科技
/
linux系統vnc開啟
linux系統vnc開啟
更新时间:2024-10-08 04:20:56

linux系統vnc開啟?這篇文章主要介紹“Linux系統安裝VNC的過程”,在日常操作中,相信很多人在Linux系統安裝VNC的過程問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”Linux系統安裝VNC的過程”的疑惑有所幫助接下來,請跟着西昆雲小編一起來學習吧,我來為大家科普一下關于linux系統vnc開啟?下面希望有你要的答案,我們一起來看看吧!

linux系統vnc開啟(Linux系統安裝VNC的過程)1

linux系統vnc開啟

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

一、安裝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/vncserversVNCSERVERS="1:root"以vnc使用用戶登錄系統,創建vnc密碼,vncpasswd [root@localhost ~]$ vncpasswdPassword: 輸入密碼Password must be at least 6 characters - try againPassword: 再次輸入密碼Verify:

啟動服務一次,生成 /home/visitor/.vnc/xstartup

[root@localhost ~]$ vncserver New 'localhost.localdomain:1 (visitor)' desktop is localhost.localdomain:1Starting applications specified in /home/visitor/.vnc/xstartup Log file is /home/visitor/.vnc/localhost.localdomain:1.log

三,啟動服務

[root@localhost ~]# /etc/init.d/vncserver start正在啟動 VNC 服務器:1:root New 'localhost.localdomain:1 (visitor)' desktop is localhost.localdomain:1Starting 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 restartiptables: Flushing firewall rules: [ OK ] iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Unloading modules: [ OK ] iptables: Applying firewall rules: [ OK ]

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

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服務 [root@localhost ~]# /etc/init.d/vncserver restar3.訪問vnc時,比如使用VNC viewer訪問,你訪問的端口比如是:192.168.2.11:9701 而你在/etc/sysconfig/vncserver中配置的桌面端口是 1:root 那麼在第1步中配置文件中修改的端口号就應該是 9701-1=9700

到此,關于“Linux系統安裝VNC的過程”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好地幫助大家學習,快去試試吧!若想繼續學習更多相關知識,請繼續關注西昆雲網站,小編會繼續努力為大家帶來更多實用的文章!

,
Comments
Welcome to tft每日頭條 comments! Please keep conversations courteous and on-topic. To fosterproductive and respectful conversations, you may see comments from our Community Managers.
Sign up to post
Sort by
Show More Comments
Copyright 2023-2024 - www.tftnews.com All Rights Reserved