Centos远程桌面

来自ling
跳转至: 导航搜索

1、安装图形化界面 安装Gnome包

yum groupinstall "GNOME Desktop" "Graphical Administration Tools" -y

更新系统运行级别

ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target

设置默认使用root用户登录 修改/etc/gdm/custom.conf配置文件,添加配置信息如下

tee /etc/gdm/custom.conf<<-'EOF'
# GDM configuration storage

[daemon]
AutomaticLoginEnable=True
AutomaticLogin=root
[security]

[xdmcp]

[chooser]

[debug]
# Uncomment the line below to turn on debugging
#Enable=true
EOF

重启系统,默认启动直接进入图形化界面

reboot

2、配置远程桌面 安装xdrp windows登录需要安装xdrp,需要先配置epel源之后方可安装xdrp

yum update
yum install -y epel-release 
yum install -y xrdp

设置开机自启

systemctl start xrdp
systemctl enable xrdp
systemctl disable firewalld.service

开放3389端口

firewall-cmd --permanent --zone=public --add-port=3389/tcp firewall-cmd --reload


1、命令行界面输入命令“systemctl status firewalld.service”并按下回车键。

2、然后在下方可度以查看得到“active(running)”,此时说明防火墙已经被打开了。

3、在命令行中输入systemctl stop firewalld.service命令,进行关闭防火墙。

4、然后再使用命令systemctl status firewalld.service,在下方出现disavtive(dead),这权样就说明防火墙已经关闭。

5、再在命令行中输入命令“systemctl disable firewalld.service”命令,即可永久关闭防火墙。