荣耀之链论坛

 找回密码
 立即注册
搜索
查看: 8815|回复: 2

centos 7 安装桌面环境,并设置RDP远程

[复制链接]

1326

主题

2373

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
10267
发表于 2018-11-10 15:10 | 显示全部楼层 |阅读模式
  1. #!/bin/bash

  2. echo "---------------------------------------------------------------------------------------------------------------------"
  3. echo "Welcome to Desktop environment and Remote connection tool ! V1.0.0"
  4. echo "System requirements: CentOS 7+ New installation"
  5. echo "Recommended system : [Original] Network one-click Reinstall CentOS 7 (Official, Pure, Safe, Efficient)"
  6. echo "URL : https://tech.cxthhhhh.com/linux/2018/07/30/original-network-one-click-reinstall-centos-7-official-pure-safe-efficient-en.html"
  7. echo "---------------------------------------------------------------------------------------------------------------------"
  8. echo "from https://tech.cxthhhhh.com - 2018/08/07 - MeowLove"
  9. echo "---------------------------------------------------------------------------------------------------------------------"
  10. echo Press any key to continue! Exit with 'Ctrl'+'C' !

  11. echo -e "\n"
  12. sudo cd /root
  13. yum install epel-release -y
  14. echo "Start creating Swaps Memory, please wait..."
  15. dd if=/dev/zero of=/var/swapd bs=1024 count=3145728
  16. mkswap /var/swapd
  17. chmod 0644 /var/swapd
  18. swapon /var/swapd
  19. echo '/var/swapd   swap   swap   default 0 0' >> /etc/fstab
  20. echo "---------------------------------------------------------------------------------------------------------------------"
  21. echo "Swaps Memory is Created  is [OK]"
  22. echo "---------------------------------------------------------------------------------------------------------------------"

  23. echo -e "\n"
  24. sudo cd /root
  25. yum groupinstall "X Window System" -y
  26. yum groupinstall "MATE Desktop" -y
  27. yum groupinstall "Chinese support" -y
  28. yum groups mark install "Chinese support" -y
  29. yum install cjkuni-ukai-fonts cjkuni-uming-fonts -y
  30. yum install fontforge -y
  31. yum install ibus-libpinyin im-chooser -y
  32. localectl set-locale LANG=zh_CN.UTF8
  33. echo "---------------------------------------------------------------------------------------------------------------------"
  34. echo "Desktop environment is installed  is [OK]"
  35. echo "---------------------------------------------------------------------------------------------------------------------"

  36. echo -e "\n"
  37. sudo cd /root
  38. touch /etc/yum.repos.d/google-chrome.repo
  39. echo '[google-chrome]
  40. name=google-chrome
  41. baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
  42. enabled=1
  43. gpgcheck=1
  44. gpgkey=https://dl.google.com/linux/linux_signing_key.pub'>/etc/yum.repos.d/google-chrome.repo
  45. echo -e "\n"
  46. cat /etc/yum.repos.d/google-chrome.repo
  47. yum install google-chrome-stable -y
  48. echo "---------------------------------------------------------------------------------------------------------------------"
  49. echo "The Chrome Already installed  is [OK]"
  50. echo "---------------------------------------------------------------------------------------------------------------------"

  51. echo -e "\n"
  52. sudo cd /root
  53. rpm -Uvh --force https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/nux-dextop/nux-dextop-release-0-5.el7.nux.noarch.rpm --quiet
  54. yum install remmina remmina-plugins-* -y
  55. echo "---------------------------------------------------------------------------------------------------------------------"
  56. echo "The Remmina Already installed  is [OK]"
  57. echo "---------------------------------------------------------------------------------------------------------------------"

  58. echo -e "\n"
  59. sudo cd /root
  60. rpm -Uvh --force https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/wine/wine32-release.rpm --quiet
  61. yum install wine.i686 -y
  62. yum install wine -y
  63. sudo wget -O /usr/share/wine/fonts/msyh.ttc https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/msyh.ttc
  64. sudo wget -O /usr/share/wine/fonts/msyhbd.ttc https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/msyhbd.ttc
  65. sudo wget -O /usr/share/wine/fonts/msyhl.ttc https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/msyhl.ttc
  66. sudo wget -O /usr/share/wine/fonts/simfang.ttf https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/simfang.ttf
  67. sudo wget -O /usr/share/wine/fonts/simhei.ttf https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/simhei.ttf
  68. sudo wget -O /usr/share/wine/fonts/simkai.ttf https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/simkai.ttf
  69. sudo wget -O /usr/share/wine/fonts/SIMLI.ttf https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/SIMLI.ttf
  70. sudo wget -O /usr/share/wine/fonts/simsun.ttc https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/simsun.ttc
  71. sudo wget -O /usr/share/wine/fonts/SIMYOU.ttf https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/SIMYOU.ttf
  72. sudo wget -O /usr/share/wine/fonts/仿宋_GB2312.ttf https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/仿宋_GB2312.ttf
  73. sudo wget -O /usr/share/wine/fonts/楷体_GB2312.ttf https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/楷体_GB2312.ttf
  74. echo "---------------------------------------------------------------------------------------------------------------------"
  75. echo "The Wine Already installed  is [OK]"
  76. echo "---------------------------------------------------------------------------------------------------------------------"

  77. echo -e "\n"
  78. sudo cd /root
  79. yum install tigervnc-server tigervnc -y
  80. yum install xrdp -y
  81. touch ~/.Xclients
  82. echo "mate-session" > ~/.Xclients
  83. chmod a+x ~/.Xclients
  84. systemctl enable xrdp
  85. systemctl start xrdp
  86. firewall-cmd --add-port=3389/tcp --permanent
  87. firewall-cmd --reload
  88. echo "---------------------------------------------------------------------------------------------------------------------"
  89. echo "Remote connection RDP is installed  is [OK]"
  90. echo "---------------------------------------------------------------------------------------------------------------------"

  91. echo -e "\n\n\n"
  92. echo "---------------------------------------------------------------------------------------------------------------------"
  93. echo "The current default system language is Chinese."
  94. echo "If you are an English user, please execute ' sudo localectl set-locale LANG=en_US.UTF-8 '"
  95. echo "---------------------------------------------------------------------------------------------------------------------"
  96. echo "Warning: Now, you need to pay attention to the following, please visit this page."
  97. echo "[Original] One-click installation of Desktop environment, RDP, Windows support for Linux"
  98. echo "https://tech.cxthhhhh.com/linux/2018/08/07/original-one-click-installation-of-desktop-environment-rdp-windows-support-for-linux-en.html"
  99. echo "---------------------------------------------------------------------------------------------------------------------"
  100. echo "End to Desktop environment and Remote connection tool ! V1.0.0"
  101. echo "Everything is ready and the system is restarting. Then you can connect via (RDP)IP:3389."
  102. echo "---------------------------------------------------------------------------------------------------------------------"
  103. echo "from https://tech.cxthhhhh.com - 2018/08/07 - MeowLove"
  104. echo "---------------------------------------------------------------------------------------------------------------------"
  105. reboot
  106. echo -e "\n"
复制代码


用root用户执行上面的脚本 就全自动安装好了
回复

使用道具 举报

1326

主题

2373

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
10267
 楼主| 发表于 2018-11-10 15:12 | 显示全部楼层
回复 支持 反对

使用道具 举报

1326

主题

2373

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
10267
 楼主| 发表于 2018-11-10 15:15 | 显示全部楼层
  1. Complete!
  2. Created symlink from /etc/systemd/system/multi-user.target.wants/xrdp.service to /usr/lib/systemd/system/xrdp.service.
  3. Warning: ALREADY_ENABLED: 3389:tcp
  4. success
  5. success
  6. ---------------------------------------------------------------------------------------------------------------------
  7. Remote connection RDP is installed  is [OK]
  8. ---------------------------------------------------------------------------------------------------------------------




  9. ---------------------------------------------------------------------------------------------------------------------
  10. The current default system language is Chinese.
  11. If you are an English user, please execute ' sudo localectl set-locale LANG=en_US.UTF-8 '
  12. ---------------------------------------------------------------------------------------------------------------------
  13. Warning: Now, you need to pay attention to the following, please visit this page.
  14. [Original] One-click installation of Desktop environment, RDP, Windows support for Linux
  15. https://tech.cxthhhhh.com/linux/2018/08/07/original-one-click-installation-of-desktop-environment-rdp-windows-support-for-linux-en.html
  16. ---------------------------------------------------------------------------------------------------------------------
  17. End to Desktop environment and Remote connection tool ! V1.0.0
  18. Everything is ready and the system is restarting. Then you can connect via (RDP)IP:3389.
  19. ---------------------------------------------------------------------------------------------------------------------
  20. from https://tech.cxthhhhh.com - 2018/08/07 - MeowLove
  21. ---------------------------------------------------------------------------------------------------------------------
复制代码


这个是安装完毕最后的提示
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

荣耀之链

GMT+8, 2025-6-18 05:21 , Processed in 0.013242 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表