Monday, January 3, 2022

How To Install Guacamole Remote Desktop on Rocky Linux 8

 Apache Guacamole is a free, open-source, web-based, and clientless remote desktop application that supports standard protocols like VNC, RDP, and SSH. It allows you to access Linux and Windows PC from a web browser via RDP, SSH, or VNC. It is clientless so you don't need to install any plugins or client software. It is made from two components Guacamole Server and Guacamole Client. Guacamole server provides server-side and native components required to connect to remote PC while Guacamole client is an HTML 5 web application used to connect to the remote PC.
________________________________________________________________________________________________________________________
๐Ž๐ฎ๐ซ ๐’๐ž๐ซ๐ฏ๐ž๐ซ ๐’๐ฉ๐ž๐œ๐ข๐Ÿ๐ข๐œ๐š๐ญ๐ข๐จ๐ง:-
๐Ž๐ฌ : ๐‘๐จ๐œ๐ค๐ฒ ๐‹๐ข๐ง๐ฎ๐ฑ ๐Ÿ–.๐Ÿ“ (๐†๐ซ๐ž๐ž๐ง ๐Ž๐›๐ฌ๐ข๐๐ข๐š๐ง)          | ๐‡๐จ๐ฌ๐ญ๐ง๐š๐ฆ๐ž:                    | ๐ˆ๐ ๐€๐๐๐ซ๐ž๐ฌ๐ฌ ๐จ๐Ÿ ๐’๐ž๐ซ๐ฏ๐ž๐ซ:
________________________________________________________________________________________________________________________
                            cat /etc/os-release ; getconf LONG_BIT ; sestatus

dnf -y update ; dnf groupinstall "Development Tools" -y && yum install java-11-openjdk-devel

dnf install -y unzip curl make cmake wget gcc zlib-devel compat-openssl10 epel-release
sudo dnf config-manager --set-enabled powertools ; sudo dnf config-manager --enable devel


dnf install cairo-devel libuv-devel libjpeg-turbo-devel libjpeg-devel libpng-devel libtool uuid-devel freerdp-devel pango-devel libvncserver-devel pulseaudio-libs-devel openssl-devel libvorbis-devel libwebp-devel libssh2-devel libtheora opus lame-libs ; dnf config-manager --disable devel

curl -s https://api.github.com/repos/seanmiddleditch/libtelnet/releases/latest | grep browser_download_url | cut -d '"' -f 4 | wget -qi -
tar -xf libtelnet-*.tar.gz ; cd libtelnet-*/ ; ./configure ; make && sudo make install

sudo groupadd --system tomcat ; sudo useradd -d /usr/share/tomcat -r -s /bin/false -g tomcat tomcat
cd ~ ; wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.56/bin/apache-tomcat-9.0.56.tar.gz
tar -xvf apache-tomcat-*.tar.gz
mkdir /usr/share/tomcat
sudo mv apache-tomcat-9.0.56/*  /usr/share/tomcat ; sudo chown -R tomcat:tomcat /usr/share/tomcat/

sudo nano /etc/systemd/system/tomcat.service
[Unit]
Description=Tomcat Server
After=syslog.target network.target

[Service]
Type=forking
User=tomcat
Group=tomcat

Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment='JAVA_OPTS=-Djava.awt.headless=true'
Environment=CATALINA_HOME=/usr/share/tomcat
Environment=CATALINA_BASE=/usr/share/tomcat
Environment=CATALINA_PID=/usr/share/tomcat/temp/tomcat.pid
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M'
ExecStart=/usr/share/tomcat/bin/catalina.sh start
ExecStop=/usr/share/tomcat/bin/catalina.sh stop

[Install]
WantedBy=multi-user.target

sudo systemctl daemon-reload ; systemctl enable --now tomcat ; systemctl status tomcat

VER=1.3.0
wget https://downloads.apache.org/guacamole/$VER/source/guacamole-server-$VER.tar.gz
tar xzf guacamole-server-$VER.tar.gz
cd guacamole-server-$VER ; ./configure --with-init-dir=/etc/init.d
make ; sudo make install ; sudo ldconfig
sudo systemctl daemon-reload ; sudo systemctl start guacd ; sudo systemctl enable guacd ;  systemctl status guacd


sudo mkdir /etc/guacamole ; cd ~
wget https://downloads.apache.org/guacamole/1.3.0/binary/guacamole-1.3.0.war
sudo mv guacamole-1.3.0.war /etc/guacamole/guacamole.war ; sudo ln -s /etc/guacamole/guacamole.war /usr/share/tomcat/webapps/
sudo echo "GUACAMOLE_HOME=/etc/guacamole" | sudo tee -a /etc/default/tomcat

sudo nano /etc/guacamole/guacamole.properties
guacd-hostname: localhost
guacd-port:    4822
user-mapping:    /etc/guacamole/user-mapping.xml
auth-provider:    net.sourceforge.guacamole.net.basic.BasicFileAuthenticationProvider

sudo ln -s /etc/guacamole /usr/share/tomcat/.guacamole
echo -n StrongPassword | openssl md5

sudo nano /etc/guacamole/user-mapping.xml
<user-mapping>
        
    <!-- Per-user authentication and config information -->

    <!-- A user using md5 to hash the password
         guacadmin user and its md5 hashed password below is used to
             login to Guacamole Web UI-->
    <authorize
            username="admin"
            password="0f6e4a1df0cf5ee97c2066953bed21b2"
            encoding="md5">

        <!-- First authorized Remote connection -->
        <connection name="Ubuntu 20.04 Server SSH">
            <protocol>ssh</protocol>
            <param name="hostname">192.168.1.80</param>
            <param name="username">ubuntu</param>
            <param name="port">22</param>
        </connection>

        <!-- Second authorized remote connection -->
        <connection name="Windows 10 RDP">
            <protocol>rdp</protocol>
            <param name="hostname">192.168.1.50</param>
            <param name="port">3389</param>
            <param name="username">test</param>
            <param name="ignore-cert">true</param>
        </connection>

    </authorize>

</user-mapping>

sudo systemctl restart tomcat guacd
sudo firewall-cmd --permanent --add-port={4822,8080}/tcp ; sudo firewall-cmd --reload
http://server-IP:8080/guacamole  [ http://192.168.1.60:8080/guacamole ]  [ admin/StrongPassword
_________________________________________________________________________________________________________________________

No comments:

Post a Comment