這篇文章主要介紹“Linux系統安裝VNC的過(guò)程”,在日常操作中,相信很多人在Linux系統安裝VNC的過(guò)程問(wèn)題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對大家解答”Linux系統安裝VNC的過(guò)程”的疑惑有所幫助!接下來(lái),請跟著(zhù)小編一起來(lái)學(xué)習吧!
[root@localhost ~]# yum install tigervnc-server ###沒(méi)有配置yum源可以使用 rpm -ivh安裝 [root@localhost ~]# rpm -qc tigervnc-server /etc/sysconfig/vncservers [root@localhost ~]# chkconfig --level 35 vncserver on
[root@localhost ~]# vim /etc/sysconfig/vncservers VNCSERVERS="1:root" 以vnc使用用戶(hù)登錄系統,創(chuàng )建vnc密碼,vncpasswd [root@localhost ~]$ vncpasswd Password: 輸入密碼 Password must be at least 6 characters - try again Password: 再次輸入密碼 Verify:
啟動(dòng)服務(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
[root@localhost ~]# /etc/init.d/vncserver start 正在啟動(dòng) VNC :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: 有時(shí)因為網(wǎng)絡(luò )安全要求,不能使用常用端口,需要更改vnc服務(wù)的默認端口,按照以下步驟即可:
1。修改vnc的默認端口
[root@localhost ~]# vim /usr/bin/vncserver
注釋?zhuān)盒薷娜缦聝尚兄心J的端口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.訪(fǎng)問(wèn)vnc時(shí),比如使用VNC viewer訪(fǎng)問(wèn),你訪(fǎng)問(wèn)的端口比如是:
192.168.2.11:9701 而你在/etc/sysconfig/vncserver中配置的桌面端口是 1:root 那么在第1步中配置文件中修改的端口號就應該是 9701-1=9700
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。
Copyright ? 2009-2022 56dr.com. All Rights Reserved. 特網(wǎng)科技 特網(wǎng)云 版權所有 特網(wǎng)科技 粵ICP備16109289號
域名注冊服務(wù)機構:阿里云計算有限公司(萬(wàn)網(wǎng)) 域名服務(wù)機構:煙臺帝思普網(wǎng)絡(luò )科技有限公司(DNSPod) CDN服務(wù):阿里云計算有限公司 百度云 中國互聯(lián)網(wǎng)舉報中心 增值電信業(yè)務(wù)經(jīng)營(yíng)許可證B2
建議您使用Chrome、Firefox、Edge、IE10及以上版本和360等主流瀏覽器瀏覽本網(wǎng)站