收藏文章 楼主

Windows通过mstsc远程桌面连接centos7 centos8

版块:shell   类型:普通   作者:小绿叶技术博客   查看:2256   回复:1   获赞:7   时间:2021-07-09 23:54:39

yum install epel-release -y

release=`cat /etc/redhat-release  |grep release | awk -F" " '{print $4}' | awk -F"." '{print $1}'` ; echo "centos 版本为: $release "

case "$release" in

"6") echo " 当前匹配centos 版本为 6"

centos6

;;

"7") echo " 当前匹配centos 版本为 7"

yum groupinstall -y "GNOME Desktop"             ##centos7 安装桌面 安装GNOME Desktop图形桌面服务

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

                                                                                # 设置桌面运行模式为默认启动模式

# reboot                                                                   # 重启系统或者    init 5         # 启动桌面模式

;;

"8") echo "当前匹配centos 版本为 8"

sudo dnf groupinstall "Server with GUI" -y # Gnome 是 CentOS 8 中的默认桌面环境

;;

*) echo "您的centos过于老旧,正在匹配低版本"

centos6d

;;

esac


yum install xrdp tigervnc-server -y

systemctl enable xrdp --now

systemctl status xrdp

echo "exec gnome-session" >>  /etc/xrdp/xrdp.ini 

systemctl restart xrdp

systemctl start firewalld


#限制防火墙

sudo firewall-cmd --add-port=3389/tcp --permanent

sudo firewall-cmd --reload


# 设置为中文

yum groupinstall -y "fonts" # groupinstall 安装软件并安装依赖
yum install -y kde-l10n-Chinese       # 安装中文语言包

# yum install *Chinese # 或者安装所有Chinese的包

sed -i 's/LANG=.*/LANG="zh_CN.UTF-8"/g' /etc/locale.conf

source /etc/locale.conf # 立即生效


# 一键安装:wget www.eisc.cn/file/shell/centos-mstsc.sh ; sh centos-mstsc.sh


#相关链接:  升级bash 设置中文语言:https://www.eisc.cn/index.php?c=read&id=616&page=1

# ubuntu 安装桌面:https://help.aliyun.com/document_detail/59330.html

提供企业建站服务,免费网防系统,提交信息登录 http://yundun.ddoss.cn 邮箱: proposal@ddoss.cn 
回复列表
默认   热门   正序   倒序

回复:Windows通过mstsc远程桌面连接centos7 centos8

头像

用户名:

粉丝数:

签名:

资料 关注 好友 消息