《LINUX教程:CentOS安裝使用VNC進(jìn)行遠(yuǎn)程桌面登錄》要點(diǎn):
本文介紹了LINUX教程:CentOS安裝使用VNC進(jìn)行遠(yuǎn)程桌面登錄,希望對(duì)您有用。如果有疑問(wèn),可以聯(lián)系我們。
以下先容在CentOS 7下安裝vncserver并使用vnc-viewer進(jìn)行登錄(使用root權(quán)限):
1、運(yùn)行敕令yum install tigervnc-server安裝vncserver;
2、運(yùn)行敕令yum install vnc安裝vnc;//感覺(jué)不安裝也可以,安裝一下也很快,不要在意這些細(xì)節(jié)
3、運(yùn)行命令yum groupinstall "X Window System"安裝X-Window;//之前安裝發(fā)現(xiàn)經(jīng)常無(wú)法啟動(dòng)vncserver,后面通過(guò)網(wǎng)上查資料介紹可以安裝X-Window辦理這個(gè) 問(wèn)題
4、安裝中文字符以辦理界面中文亂碼的問(wèn)題:yum install dejavu-lgc-sans-fonts、yum groupinstall "Fonts" -y
5、禁用防火墻,假如已經(jīng)禁用防火墻可以跳過(guò)這一步:systemctl stop firewalld.service、systemctl disable firewalld.service
6、配置vncserver:
拷貝創(chuàng)建一個(gè)新的配置文件,以開(kāi)啟1號(hào)窗口為例,如果必要開(kāi)啟多個(gè)則創(chuàng)建多個(gè)配置文件即可:
[root@localhost ~]# cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:1.service
修改配置文件內(nèi)容
[root@localhost ~]# vi /lib/systemd/system/vncserver@:1.service
# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@.service
# 2. Replace <USER> with the actual user name and edit vncserver
# parameters appropriately
# ("User=<USER>" and "/home/<USER>/.vnc/%H%i.pid")
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB's port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# 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.
?
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
User=root
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=-/usr/bin/vncserver -kill %i
ExecStart=/usr/bin/vncserver %i
PIDFile=/root/.vnc/%H%i.pid
ExecStop=-/usr/bin/vncserver -kill %i
[Install]
WantedBy=multi-user.target
7、運(yùn)行敕令systemctl daemon-reload更新systemctl;
8、運(yùn)行命令vncpasswd root設(shè)置vncserver的暗碼;
9、運(yùn)行敕令systemctl start vncserver@:1.service(可以運(yùn)行systemctl enable vncserver@:1.service敕令設(shè)置為默認(rèn)啟動(dòng)服務(wù));//啟動(dòng)不了則重啟一下系統(tǒng)或則查看啟動(dòng)日志
10、重啟系統(tǒng)后使用VNC-Viewer連接:192.168.10.100:1,輸入設(shè)置的暗碼即可登錄.
CentOS 6.7下VNC安裝?
CentOS 7 安裝設(shè)置裝備擺設(shè) VNC 詳解?
CentOS7.1安裝VNC,讓W(xué)in7長(zhǎng)途桌面Linux?
CentOS下VNC連接黑屏問(wèn)題辦理? ?
Ubuntu下安裝配置VNC長(zhǎng)途工具?
本文永遠(yuǎn)更新鏈接地址:
學(xué)習(xí)更多LINUX教程,請(qǐng)查看站內(nèi)專欄,如果有LINUX疑問(wèn),可以加QQ交流《LINUX教程:CentOS安裝使用VNC進(jìn)行遠(yuǎn)程桌面登錄》。
轉(zhuǎn)載請(qǐng)注明本頁(yè)網(wǎng)址:
http://www.fzlkiss.com/jiaocheng/7020.html