centos 7 安裝和配置vncserver centos 7 安裝和配置vncserver

centos 7 安裝和配置vncserver

 前期準備:html

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

1
systemctl stop firewalld.service

CentOS 7.0默認使用的是firewall做爲防火牆,使用iptables必須從新設置一下vim

一、直接關閉防火牆centos

systemctl stop firewalld.service #中止firewallbash

systemctl disable firewalld.service #禁止firewall開機啓動服務器

二、設置 iptables servicetcp

yum -y install iptables-servicespost

若是要修改防火牆配置,如增長防火牆端口3306url

vi /etc/sysconfig/iptables spa

增長規則

-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

1
yum groupinstall "GNOME Desktop"

  

1.安裝tigervncserver

1
yum install tigervnc-server tigervnc-server-module

2.拷貝配置文件

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

3.進入到配置文件目錄

1
cd /etc/systemd/system

4.修改配置文件

1
vim 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.  啓用配置文件

1
systemctl enable vncserver@:1.service

 6. 設置登錄密碼

1
vncpasswd

 

 7. 啓動vncserver

1
systemctl start vncserver@:1.service  

 8 . 啓動狀態查看

1
systemctl status vncserver@:1.service

 9.查看端口狀態

1
netstat -lnt | grep 590*

 10.查看報錯信息

 

1
grep vnc /var/log/messages
相關文章
相關標籤/搜索