centos 7 安裝和配置vncserver

2022-08-25 10:06:18 字數 2823 閱讀 1470

前期準備:

關閉防火牆,centos的防火牆是firewalld,關閉防火牆的命令

1systemctl stop firewalld.service

centos 7.0預設使用的是firewall作為防火牆,使用iptables必須重新設定一下

1、直接關閉防火牆

systemctl stop firewalld.service #停止firewall

systemctl disable firewalld.service #禁止firewall開機啟動

2、設定 iptables service

yum -y install iptables-services

如果要修改防火牆配置,如增加防火牆埠3306

vi /etc/sysconfig/iptables 

增加規則

-a input -m state --state new -m tcp -p tcp --dport 3306 -j accept

儲存退出後

systemctl restart iptables.service #重啟防火牆使配置生效

systemctl enable iptables.service #設定防火牆開機啟動

最後重啟系統使設定生效即可。

關閉selinux

1 永久方法 – 需要重啟伺服器

修改/etc/selinux/config檔案中設定selinux=disabled ,然後重啟伺服器。

2 臨時方法 – 設定系統引數

使用命令setenforce 0

centos 伺服器版需安裝 gnome desktop

1yum groupinstall"gnome desktop"

1.安裝tigervncserver

1yuminstalltigervnc-server tigervnc-server-module

2.拷貝配置檔案

1cp/lib/systemd/system/vncserver@.service/etc/systemd/system/vncserver@:1.service

3.進入到配置檔案目錄

1cd/etc/systemd/system

4.修改配置檔案

1vim vncserver@:1.service

配置檔案內容為:

[unit]

description=remote desktop service (vnc)

after=syslog.target network.target

[service]

type=forking

user=root

execstart=/usr/bin/vncserver :1 -geometry 1280x1024 -depth 16 -securitytypes=none -fp /usr/share/x11/fonts/misc

execstop=/usr/bin/vncserver -kill :1

[install]

wantedby=multi-user.target

5.  啟用配置檔案

1systemctlenablevncserver@:1.service

6. 設定登陸密碼

1vncpasswd

7. 啟動vncserver

1systemctl start vncserver@:1.service

8 . 啟動狀態檢視

1systemctl status vncserver@:1.service

9.檢視埠狀態

1netstat-lnt |grep590*

10.檢視報錯資訊

1grepvnc/var/log/messages

centos 7.0預設使用的是firewall作為防火牆,使用iptables必須重新設定一下

1、直接關閉防火牆

systemctl stop firewalld.service #停止firewall

systemctl disable firewalld.service #禁止firewall開機啟動

2、設定 iptables service

yum -y install iptables-services

如果要修改防火牆配置,如增加防火牆埠3306

vi /etc/sysconfig/iptables 

增加規則

-a input -m state --state new -m tcp -p tcp --dport 3306 -j accept

儲存退出後

systemctl restart iptables.service #重啟防火牆使配置生效

systemctl enable iptables.service #設定防火牆開機啟動

最後重啟系統使設定生效即可。

Centos7安裝配置vnc

前提條件,已經安裝了乙個圖形介面 yum install tigervnc server y 安裝vnc服務 systemctl status vncserver service 檢查服務狀態 vncserver service remote desktop service vnc loaded l...

CentOS 7 安裝配置 VNC 詳解

from vnc是什麼 virtual network computing vnc允許linux系統可以類似實現像windows中的遠端桌面訪問那樣訪問linux桌面。本文配置是在centos 7 hp伺服器環境下執行。首先試試伺服器裝了vnc沒 root linuxidc rpm q tigerv...

CentOS 7 安裝配置 VNC 詳解

vnc是什麼 virtual network computing vnc允許linux系統可以類似實現像windows中的遠端桌面訪問那樣訪問linux桌面。本文配置是在centos 7 hp伺服器環境下執行。首先試試伺服器裝了vnc沒 root linuxidc rpm q tigervnc ti...