1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > Windows远程连接Ubuntu桌面

Windows远程连接Ubuntu桌面

时间:2021-02-21 11:50:22

相关推荐

Windows远程连接Ubuntu桌面

1 .命令框输入以下内容

cd ~

touch xrdp-installer-1.2.1.sh

2.命令框输入以下内容

gedit xrdp-installer-1.2.1.sh

3.命令框输入以下内容

#!/bin/bash###################################################################################################### Script_Name : xrdp-installer-1.2.1.sh# Description : Perform xRDP installation on Ubuntu 16.04,18.04,19.04,19.10 and perform#additional post configuration to improve end user experience# Date : November # written by : Griffon# WebSite :http://www.c-nergy.be - http://www.c-nergy.be/blog# Version : 1.2.1 # History : 1.2.1 - Adding Support to Ubuntu 20.10 + Removed support for Ubuntu 19.10# 1.2 - Adding Support to Ubuntu 20.04 + Removed support for Ubuntu 19.04# - Stricter Check for HWE Package (thanks to Andrej Gantvorg)# - Changed code in checking where to copy image for login screen customization # - Fixed Bug checking SSL group membership # - Updating background color xrdp login screen # - Updating pkgversion to x.13 for checkinstall process# : 1.1 - Tackling multiple run of the script # - Improved checkinstall method/check ssl group memberhsip# - Replaced ~/Downloads by a variable # : 1.0 - Added remove option + Final optimization# : 0.9 - updated compile section to use checkinstall# : 0.8 - Updated the fix_theme function to add support for Ubuntu 16.04 # : 0.7 - Updated prereqs function to add support for Ubuntu 16.04# : 0.6 - Adding logic to detect Ubuntu version for U16.04 # : 0.5 - Adding env variable Fix # : 0.4 - Adding SSL Fix # : 0.3 - Adding custom login screen option # : 0.2 - Adding new code for passing parameters # : 0.1 - Initial Script (merging custom & Std) # Disclaimer : Script provided AS IS. Use it at your own risk....# You can use this script and distribute it as long as credits are kept # in place and unchanged #####################################################################################################--------------------------------------------------------------------------## -----------------------Function Section - DO NOT MODIFY -----------------##--------------------------------------------------------------------------############################################################################## DEFAULT INSTALLATION MODE : STANDARD INSTALLATION #############################################################################---------------------------------------------------## Function 1 - check xserver-xorg-core package....#---------------------------------------------------#check_hwe(){Release=$(lsb_release -sr)echo/bin/echo -e "\e[1;33m |-| Detecting xserver-xorg-core package installed \e[0m"xorg_no_hwe_install_status=$(dpkg-query -W -f ='${Status}\n' xserver-xorg-core 2>/dev/null)xorg_hwe_install_status=$(dpkg-query -W -f ='${Status}\n' xserver-xorg-core-hwe-$Release 2>/dev/null) if [[ "$xorg_hwe_install_status" =~ \ installed$ ]]then# – hwe version is installed on the system/bin/echo -e "\e[1;32m |-| xorg package version: xserver-xorg-core-hwe \e[0m"HWE="yes"elif [[ "$xorg_no_hwe_install_status" =~ \ installed$ ]]then/bin/echo -e "\e[1;32m |-| xorg package version: xserver-xorg-core \e[0m"HWE="no"else/bin/echo -e "\e[1;31m |-| Error checking xserver-xorg-core flavour \e[0m"exit 1fi}#---------------------------------------------------## Function 2 - Install xRDP Software....#---------------------------------------------------#install_xrdp(){echo/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;33m ! Installing XRDP Packages...Proceeding... !\e[0m"/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"echoif [[ $HWE = "yes" ]] && [[ "$version" = *"Ubuntu 18.04"* ]];thensudo apt-get install xrdp -ysudo apt-get install xorgxrdp-hwe-18.04elsesudo apt-get install xrdp -yfi}############################################################################# ADVANCED INSTALLATION MODE : CUSTOM INSTALLATION#############################################################################---------------------------------------------------## Function 0 - Install Prereqs...#---------------------------------------------------#install_prereqs() {echoRelease=$(lsb_release -sr)/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;33m ! Installing PreReqs packages..Proceeding. ! \e[0m"/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"echosudo apt-get -y install libx11-dev libxfixes-dev libssl-dev libpam0g-dev libtool libjpeg-dev flex bison gettext autoconf libxml-parser-perl libfuse-dev xsltproc libxrandr-dev python-libxml2 nasm fuse pkg-config git intltool checkinstallechoif [ $HWE = "yes" ];then# - xorg-hwe-* to be installed/bin/echo -e "\e[1;32m |-| xorg package version: xserver-xorg-core-hwe-$Release \e[0m"sudo apt-get install -y xserver-xorg-dev-hwe-$Release xserver-xorg-core-hwe-$Releaseelse#-no-hwe/bin/echo -e "\e[1;32m |-| xorg package version: xserver-xorg-core \e[0m"echosudo apt-get install -y xserver-xorg-dev xserver-xorg-corefi}#---------------------------------------------------## Function 1 - Download XRDP Binaries... #---------------------------------------------------#get_binaries() { echo/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;33m ! Download xRDP Binaries.......Proceeding. ! \e[0m"/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"echo#cd ~/DownloadsDwnload=$(xdg-user-dir DOWNLOAD)cd $Dwnload## -- Download the xrdp latest filesecho/bin/echo -e "\e[1;32m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;32m ! Preparing download xrdp package !\e[0m"/bin/echo -e "\e[1;32m !---------------------------------------------!\e[0m"echogit clone /neutrinolabs/xrdp.gitecho/bin/echo -e "\e[1;32m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;32m ! Preparing download xorgxrdp package !\e[0m"/bin/echo -e "\e[1;32m !---------------------------------------------!\e[0m"echogit clone /neutrinolabs/xorgxrdp.git}#---------------------------------------------------## Function 2 - compiling xrdp... #---------------------------------------------------#compile_source() { echo/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;33m ! Compile xRDP packages .......Proceeding. ! \e[0m"/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"echo#cd ~/Downloads/xrdpcd $Dwnload/xrdpsudo ./bootstrapsudo ./configure --enable-fuse --enable-jpeg --enable-rfxcodecsudo make#-- check if no error during compilation if [ $? -eq 0 ]then /bin/echo -e "\e[1;33m |-| Make Operation Completed successfully \e[0m"else echoecho/bin/echo -e "\e[1;31m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;31m ! Error while Executing make!\e[0m"/bin/echo -e "\e[1;31m ! The Script is exiting.... !\e[0m"/bin/echo -e "\e[1;31m !---------------------------------------------!\e[0m"exitfisudo checkinstall --pkgname=xrdp --pkgversion=0.9.13 --pkgrelease=1 --default#xorgxrdp package compilationecho/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;33m ! Compile xorgxrdp packages....Proceeding. ! \e[0m"/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"echo#cd ~/Downloads/xorgxrdp cd $Dwnload/xorgxrdpsudo ./bootstrap sudo ./configure sudo make# check if no error during compilation if [ $? -eq 0 ]then echo/bin/echo -e "\e[1;33m |-| Make Operation Completed successfully \e[0m"echoelse echo/bin/echo -e "\e[1;31m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;31m ! Error while Executing make!\e[0m"/bin/echo -e "\e[1;31m ! The Script is exiting.... !\e[0m"/bin/echo -e "\e[1;31m !---------------------------------------------!\e[0m"exitfisudo checkinstall --pkgname=xorgxrdp --pkgversion=0.2.13 --pkgrelease=1 --default}#---------------------------------------------------## Function 3 - create services .... #---------------------------------------------------# enable_service() {echo/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;33m ! Creating xRDP services.......Proceeding. ! \e[0m"/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"echo sudo systemctl daemon-reloadsudo systemctl enable xrdp.servicesudo systemctl enable xrdp-sesman.servicesudo systemctl start xrdp}############################################################################# COMMON FUNCTIONS - WHATEVER INSTALLATION MODE #############################################################################---------------------------------------------------## Function 0 - Install Gnome Tweak Tool.... #---------------------------------------------------#install_tweak() {echo/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;33m ! Installing Gnome Tweak...Proceeding... !\e[0m"/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"echosudo apt-get install gnome-tweak-tool -y}#--------------------------------------------------------------------## Fucntion 1 - Allow console Access ....(seems optional in u18.04)#--------------------------------------------------------------------#allow_console() {echo/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;33m ! Granting Console Access...Proceeding... !\e[0m"/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"echosudo sed -i 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config}#---------------------------------------------------## Function 2 - create policies exceptions .... #---------------------------------------------------#create_polkit(){echo/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;33m ! Creating Polkit File...Proceeding...!\e[0m"/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"echo#All Ubuntu versionsudo bash -c "cat >/etc/polkit-1/localauthority/50-local.d/45-allow.colord.pkla" <<EOF[Allow Colord all Users]Identity=unix-user:*Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profileResultAny=noResultInactive=noResultActive=yesEOF#Specific Versionsif [[ "$version" = *"Ubuntu 19.10"* ]] || [[ "$version" = *"Ubuntu 20.04"* ]] ;thensudo bash -c "cat >/etc/polkit-1/localauthority/50-local.d/46-allow-update-repo.pkla" <<EOF[Allow Package Management all Users]Identity=unix-user:*Action=org.freedesktop.packagekit.system-sources-refreshResultAny=yesResultInactive=yesResultActive=yesEOFfi}#---------------------------------------------------## Function 3 - Fixing Theme and Extensions .... #---------------------------------------------------#fix_theme(){echo/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;33m ! Fix Theme and extensions...Proceeding... !\e[0m"/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"# Checking if script has run already if [ -f /etc/xrdp/startwm.sh.griffon ]thensudo rm /etc/xrdp/startwm.shsudo mv /etc/xrdp/startwm.sh.griffon /etc/xrdp/startwm.shfi #Backup the file before modifying itsudo cp /etc/xrdp/startwm.sh /etc/xrdp/startwm.sh.griffonif [[ "$version" = *"Ubuntu 16.04"* ]];thenechosudo sed -i "/# auth /a cat >~/.xsession << EOF\n#Unity Xrdp multi-users \n/usr/lib/gnome-session/gnome-session-binary --session=ubuntu &\n/usr/lib/x86_64-linux-gnu/unity/unity-panel-service &\n/usr/lib/unity-settings-daemon/unity-settings-daemon &\nfor indicator in /usr/lib/x86_64-linux-gnu/indicator-*;\ndo\nbasename='basename \\\\\${indicator}'\ndirname='dirname \\\\\${indicator}'\nservice=\\\\\${dirname}/\\\\\${basename}/\\\\\${basename}-service\n\\\\\${service} &\ndone\nunity\nEOF" /etc/xrdp/startwm.shechoelse echosudo sed -i "4 a #Improved Look n Feel Method\ncat <<EOF > ~/.xsessionrc\nexport GNOME_SHELL_SESSION_MODE=ubuntu\nexport XDG_CURRENT_DESKTOP=ubuntu:GNOME\nexport XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg\nEOF\n" /etc/xrdp/startwm.shechofi}#---------------------------------------------------## Function 4 - Enable Sound Redirection .... #---------------------------------------------------#enable_sound(){echo/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"/bin/echo -e "\e[1;33m ! Enabling Sound Redirection... !\e[0m"/bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m"echo# Step 1 - Enable Source Code Repositorysudo apt-add-repository -s 'deb http://be./ubuntu/ '$codename' main restricted'sudo apt-add-repository -s 'deb http://be./ubuntu/ '$codename' restricted universe main multiverse'sudo apt-add-repository -s 'deb http://be./ubuntu/ '$codename'-updates restricted universe main multiverse'sudo apt-add-repository -s 'deb http://be./ubuntu/ '$codename'-backports main restricted universe multiverse'sudo apt-add-repository -s 'deb http://be./ubuntu/ '$codename'-security main restricted universe main multiverse'sudo apt-get update# Step 2 - Install Some PreReqssudo apt-get install git libpulse-dev autoconf m4 intltool build-essential dpkg-dev libtool libsndfile-dev libcap-dev -y libjson-c-devsudo apt build-dep pulseaudio -y# Step 3 - Download pulseaudio source in /tmp directory - Do not forget to enable source repositoriescd /tmpsudo apt source pulseaudio# Step 4 - Compilepulsever=$(pulseaudio --version | awk '{print $2}')cd /tmp/pulseaudio-$pulseversudo ./configure# step 5 - Create xrdp sound modulessudo git clone /neutrinolabs/pulseaudio-module-xrdp.gitcd pulseaudio-module-xrdpsudo ./bootstrap sudo ./configure PULSE_DIR="/tmp/pulseaudio-$pulsever"sudo make#Step 6 copy files to correct location (as defined in /etc/xrdp/pulse/default.pa)cd /tmp/pulseaudio-$pulsever/pulseaudio-module-xrdp/src/.libssudo install -t "/var/lib/xrdp-pulseaudio-installer" -D -m 644 *.sosudo install -t "/usr/lib/pulse-$pulsever/modules" -D -m 644 *.soecho}#---------------------------------------------------## Function 5 - Custom xRDP Login Screen .... #---------------------------------------------------#custom_login(){echo /bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m" /bin/echo -e "\e[1;33m ! Customizing xRDP login screen!\e[0m" /bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m" echo Dwnload=$(xdg-user-dir DOWNLOAD)echo "go to Download folder"echoecho $Dwnload#cd ~/Downloadscd $Dwnloadwget http://www.c-nergy.be/downloads/griffon_logo_xrdp.bmp#Check if script has run once...if [ -f /etc/xrdp/xrdp.ini.griffon ]thensudo rm /etc/xrdp/xrdp.inisudo mv /etc/xrdp/xrdp.ini.griffon /etc/xrdp/xrdp.inifi #Backup file sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.griffon#Check where to copy the logo fileif [ -d "/usr/local/share/xrdp" ] thenecho "Directory /path/to/dir exists." sudo cp griffon_logo_xrdp.bmp /usr/local/share/xrdpsudo sed -i 's/ls_logo_filename=/ls_logo_filename=\/usr\/local\/share\/xrdp\/griffon_logo_xrdp.bmp/g' /etc/xrdp/xrdp.inielsesudo cp griffon_logo_xrdp.bmp /usr/share/xrdpsudo sed -i 's/ls_logo_filename=/ls_logo_filename=\/usr\/share\/xrdp\/griffon_logo_xrdp.bmp/g' /etc/xrdp/xrdp.inifi#4F194Csudo sed -i 's/blue=009cb5/blue=dedede/' /etc/xrdp/xrdp.inisudo sed -i 's/#white=ffffff/white=dedede/' /etc/xrdp/xrdp.inisudo sed -i 's/#ls_title=My Login Title/ls_title=Remote Desktop for Linux/' /etc/xrdp/xrdp.inisudo sed -i 's/ls_top_window_bg_color=009cb5/ls_top_window_bg_color=4F194C/' /etc/xrdp/xrdp.inisudo sed -i 's/ls_bg_color=dedede/ls_bg_color=ffffff/' /etc/xrdp/xrdp.inisudo sed -i 's/ls_logo_x_pos=55/ls_logo_x_pos=0/' /etc/xrdp/xrdp.inisudo sed -i 's/ls_logo_y_pos=50/ls_logo_y_pos=5/' /etc/xrdp/xrdp.ini}#---------------------------------------------------## Function 6 - Fix SSL Minor Issue .... #---------------------------------------------------#fix_ssl() { echo /bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m" /bin/echo -e "\e[1;33m ! Fixing SSL Cert Issue ... !\e[0m" /bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m" echo if id -Gn xrdp | grep ssl-cert then /bin/echo -e "\e[1;32m !--xrdp already member ssl-cert...Skipping ---!\e[0m" elsesudo adduser xrdp ssl-cert fi}#---------------------------------------------------## Function 7 - Fixing env variables in XRDP .... #---------------------------------------------------#fix_env(){#Add this line to /etc/pam.d/xrdp-sesman if not presentif grep -Fxq "session required pam_env.so readenv=1 user_readenv=0" /etc/pam.d/xrdp-sesman thenecho "Env settings already set"elsesudo sed -i '1 a session required pam_env.so readenv=1 user_readenv=0' /etc/pam.d/xrdp-sesmanfi}#---------------------------------------------------## Function 8 - Removing XRDP Packages .... #---------------------------------------------------#remove_xrdp(){echo /bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m" /bin/echo -e "\e[1;33m ! Removing xRDP Packages... !\e[0m" /bin/echo -e "\e[1;33m !---------------------------------------------!\e[0m" echo #remove xrdp packagesudo systemctl stop xrdpsudo systemctl disable xrdpsudo apt-get autoremove xrdp -ysudo apt-get purge xrdp -y#remove xorgxrdpsudo systemctl stop xorgxrdpsudo systemctl disable xorgxrdp sudo apt-get autoremove xorgxrdp -y sudo apt-get purge xorgxrdp -y}sh_credits(){echo/bin/echo -e "\e[1;36m !----------------------------------------------------------------!\e[0m"/bin/echo -e "\e[1;36m ! Installation Completed...Please test your xRDP configuration !\e[0m" /bin/echo -e "\e[1;36m ! If Sound option selected, shutdown your machine completely!\e[0m"/bin/echo -e "\e[1;36m ! start it again to have sound working as expected!\e[0m"/bin/echo -e "\e[1;36m ! !\e[0m"/bin/echo -e "\e[1;36m ! Credits : Written by Griffon - Nov. !\e[0m"/bin/echo -e "\e[1;36m ! www.c-nergy.be -xrdp-installer-v1.2.sh - ver 1.2.1 !\e[0m"/bin/echo -e "\e[1;36m !----------------------------------------------------------------!\e[0m"echo}#---------------------------------------------------## SECTION FOR OPTIMIZING CODE USAGE... ##---------------------------------------------------#install_common(){allow_consolecreate_polkitfix_themefix_sslfix_env}install_custom(){install_prereqsget_binariescompile_sourceenable_service}#--------------------------------------------------------------------------## -----------------------END Function Section -----------------##--------------------------------------------------------------------------##--------------------------------------------------------------------------##------------ MAIN SCRIPT SECTION -------------------# #--------------------------------------------------------------------------##---------------------------------------------------## Script Version information Displayed ##---------------------------------------------------#echo/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"/bin/echo -e "\e[1;36m ! xrdp-installer-1.2.1 Script !\e[0m"/bin/echo -e "\e[1;36m ! Support U16.04/18.04/19.10/20.04/20.10!\e[0m"/bin/echo -e "\e[1;36m ! Written by Griffon - Nov - www.c-nergy.be !\e[0m"/bin/echo -e "\e[1;36m ! !\e[0m"/bin/echo -e "\e[1;36m ! For Help and Syntax, type ./xrdp-installer-1.2.1.sh -h !\e[0m"/bin/echo -e "\e[1;36m ! !\e[0m"/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"echo#----------------------------------------------------------## Step 0 -Detecting if Parameters passed to script .... ##----------------------------------------------------------#for arg in "$@"do#Help Menu Requestedif [ "$arg" == "--help" ] || [ "$arg" == "-h" ]thenecho "Usage Syntax and Examples"echoecho " --custom or -c custom xRDP install (compilation from sources)"echo " --loginscreen or -lcustomize xRDP login screen"echo " --remove or -r removing xRDP packages"echo " --sound or -s enable sound redirection in xRDP"echoecho "example "echoecho " ./xrdp-installer-1.0.sh -c -s custom install with sound redirection"echo " ./xrdp-installer-1.0.sh -lstandard install with custom login screen"echo " ./xrdp-installer-1.0.sh standard install no additional features"echoexitfiif [ "$arg" == "--sound" ] || [ "$arg" == "-s" ]thenfixSound="yes" fi if [ "$arg" == "--loginscreen" ] || [ "$arg" == "-l" ]thenfixlogin="yes"fiif [ "$arg" == "--custom" ] || [ "$arg" == "-c" ]thenadv="yes"fiif [ "$arg" == "--remove" ] || [ "$arg" == "-r" ]thenremoval="yes"fidone#--------------------------------------------------------------------------------##-- Step 0 - Check that the script is run as normal user and not as root....#-------------------------------------------------------------------------------#if [[ $EUID -ne 0 ]]; then/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"/bin/echo -e "\e[1;36m ! Standard user detected....Proceeding.... !\e[0m"/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"elseecho/bin/echo -e "\e[1;31m !-------------------------------------------------------------!\e[0m"/bin/echo -e "\e[1;31m ! Script launched with sudo command. Script will not run... !\e[0m"/bin/echo -e "\e[1;31m ! Run script a standard user account (no sudo). When needed !\e[0m"/bin/echo -e "\e[1;31m ! script will be prompted for password during execution!\e[0m"/bin/echo -e "\e[1;31m ! !\e[0m"/bin/echo -e "\e[1;31m ! Exiting Script - No Install Performed !!! !\e[0m"/bin/echo -e "\e[1;31m !-------------------------------------------------------------!\e[0m"echo#sh_creditsexitfi#---------------------------------------------------##-- Step 1 - Try to Detect Ubuntu Version....#---------------------------------------------------#version=$(lsb_release -sd)codename=$(lsb_release -sc)echo/bin/echo -e "\e[1;33m |-| Detecting Ubuntu version \e[0m"if [[ "$version" = *"Ubuntu 16.04"* ]];then/bin/echo -e "\e[1;32m |-| Ubuntu Version : $version\e[0m"echoelif [[ "$version" = *"Ubuntu 18.04"* ]];then/bin/echo -e "\e[1;32m |-| Ubuntu Version : $version\e[0m"echoelif [[ "$version" = *"Ubuntu 20.04"* ]];then/bin/echo -e "\e[1;32m |-| Ubuntu Version : $version\e[0m"echoelif [[ "$version" = *"Ubuntu 20.10"* ]];then/bin/echo -e "\e[1;32m |-| Ubuntu Version : $version\e[0m"echoelse/bin/echo -e "\e[1;31m !--------------------------------------------------------------!\e[0m"/bin/echo -e "\e[1;31m ! Your system is not running a supported version!\e[0m"/bin/echo -e "\e[1;31m ! The script has been tested only on the following versions !\e[0m"/bin/echo -e "\e[1;31m ! U16.04.x/18.04.x/19.10/20.0X !\e[0m"/bin/echo -e "\e[1;31m ! The script is exiting... !\e[0m" /bin/echo -e "\e[1;31m !--------------------------------------------------------------!\e[0m"echoexitfi#-----------------------------------------------------------------------#Step 2 - checking for additional Settings - xorg-xserver-core version#----------------------------------------------------------------------check_hwe#--------------------------------------------------------------------------------##-- Step 3 - Check if Removal Option Selected#--------------------------------------------------------------------------------#if [ "$removal" = "yes" ];thenremove_xrdpechosh_creditsexitfi#---------------------------------------------------------## Step 4 - Executing the installation & config tasks .... ##---------------------------------------------------------##-------------------------------------------------------------------#- If Ubuntu 16.04 detected, we always perform a custom installation#-------------------------------------------------------------------#Check if script has run once...if [ -f /etc/xrdp/xrdp-installer-check.log ]thenecho/bin/echo -e "\e[1;36m !----------------------------------------------------------------!\e[0m"/bin/echo -e "\e[1;36m ! INFO : xrdp-install script ran at least once on this computer. !\e[0m" /bin/echo -e "\e[1;36m !----------------------------------------------------------------!\e[0m"elseif [[ "$version" = *"Ubuntu 16.04"* ]];thenecho/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"/bin/echo -e "\e[1;36m ! Custom Installation for Ubuntu 16.04.x !\e[0m"/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"echoinstall_custominstall_commonfi#---------------------------------------------------------------------------------------#- If custom option detected, additional check for U16.04 so skipped#----------------------------------------------------------------------------------------if [[ "$version" != *"Ubuntu 16.04"* ]];thenif [ "$adv" = "yes" ];thenecho/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"/bin/echo -e "\e[1;36m ! Custom Installation Option Selected..... !\e[0m"/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"echoinstall_custominstall_tweakinstall_commonelseecho/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"/bin/echo -e "\e[1;36m ! Standard Installation Mode Selected - U18.04 and later!\e[0m"/bin/echo -e "\e[1;36m !-------------------------------------------------------------!\e[0m"echoinstall_xrdpinstall_tweakinstall_commonfi #end if Adv optionfi # end if version check not like U16.04fi # End check if file exists#---------------------------------------------------------------------------------------#- Check for Additional Options selected #----------------------------------------------------------------------------------------if [ "$fixSound" = "yes" ]; then enable_soundfiif [ "$fixlogin" = "yes" ]; thenechocustom_loginfi#-----------------------------------------------------------------------# Create Check file to see if script has run at least once...#----------------------------------------------------------------------#Create the log file sudo touch /etc/xrdp/xrdp-installer-check.log#---------------------------------------------------------------------------------------#- show Credits and finishing script#--------------------------------------------------------------------------------------- sh_credits

4.命令框输入以下内容

chmod +x xrdp-installer-1.2.1.sh

5.命令框输入以下内容

./xrdp-installer-1.2.1.sh

windows上搜索远程桌面

输入Ubuntu的IP进行连接,Ubuntu中输入如下命令查看IP

ifconfig

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。