Opensourcetechブログ

OpensourcetechによるNGINX/Kubernetes/Zabbix/Neo4j/Linuxなどオープンソース技術に関するブログです。

リモートアクセス(SSH/RDPなど)の踏み台サーバ Apache Guacamoleを使ってみる


LinuCエヴァンジェリストの鯨井貴博@opensourcetechです。


はじめに
今回は、リモートアクセスの踏み台サーバであるApache Guacamoleを使ってみます。



Apache Guacamole
Apache Guacamoleは、SSH・RDP・VNCに対応した踏み台サーバです。

Apache Guacamoleはユーザ認証機能や接続先情報を持っていて、そこにブラウザでアクセスします。


Apache Guacamoleのインストール
※CentOS7を使っています。
guacd(Guacamole)とtomcatをインストールします。

[root@localhost ~]# yum -y install epel-release ・・・epelレポジトリを導入
[root@localhost ~]# yum -y install guacd libguac libguac-client-rdp libguac-client-ssh ・・・Guacamoleとその他必要なパッケージの導入
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                                         9.1 kB  00:00:00     
 * base: ftp.iij.ad.jp
 * epel: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ guacd.x86_64 1:1.4.0-1.el7 を インストール
--> 依存性の処理をしています: libogg.so.0()(64bit) のパッケージ: 1:guacd-1.4.0-1.el7.x86_64
--> 依存性の処理をしています: libvorbis.so.0()(64bit) のパッケージ: 1:guacd-1.4.0-1.el7.x86_64
--> 依存性の処理をしています: libvorbisenc.so.2()(64bit) のパッケージ: 1:guacd-1.4.0-1.el7.x86_64
--> 依存性の処理をしています: libwebp.so.4()(64bit) のパッケージ: 1:guacd-1.4.0-1.el7.x86_64
---> パッケージ libguac.x86_64 1:1.4.0-1.el7 を インストール
.
.
.
[root@localhost ~]# yum -y install java-latest-openjdk tomcat tomcat-webapps ・・・tomcat(ユーザにWeb画面を提供する)と必要パッケージの導入
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
パッケージ java-latest-openjdk は利用できません。
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ tomcat.noarch 0:7.0.76-16.el7_9 を インストール
--> 依存性の処理をしています: tomcat-lib = 7.0.76-16.el7_9 のパッケージ: tomcat-7.0.76-16.el7_9.noarch
--> 依存性の処理をしています: java >= 1:1.6.0 のパッケージ: tomcat-7.0.76-16.el7_9.noarch
.
.
.


Guacamoleの設定ディレクトリの作成

[root@localhost ~]# mkdir -p /etc/guacamole/{lib,extensions}

[root@localhost ~]# ls /etc/guacamole/
extensions  lib


Guacamoleアプリケーションのtomcatディレクトリへの配置

[root@localhost ~]# curl -L https://dlcdn.apache.org/guacamole/1.4.0/binary/guacamole-1.4.0.war

[root@localhost ~]# ls
guacamole-1.4.0.war

[root@localhost ~]# cp guacamole-1.4.0.war /var/lib/tomcat/webapps/guacamole.war

[root@localhost ~]# ls /var/lib/tomcat/webapps/
ROOT/          examples/      guacamole/     guacamole.war  sample/



Apache Guacamoleの設定
続いて、設定。
guacd.confでは、Guacamoleで公開するIPアドレスとポート番号を指定します。

[root@localhost guacamole]# vi /etc/guacamole/guacd.conf

[root@localhost guacamole]# cat /etc/guacamole/guacd.conf
[server]
bind_host = 127.0.0.1
bind_port = 4822


guacamole.propertiesには、ユーザの認証情報と接続先情報を記載するファイル名(user-mapping.xml)などを記載します。

[root@localhost guacamole]# cat /etc/guacamole/guacamole.properties 
guacd-hostname: 127.0.0.1
guacd-port:     4822

lib-directory:  /var/lib/guacamole/classpath

auth-provider: net.sourceforge.guacamole.net.basic.BasicFileAuthenticationProvider

basic-user-mapping: /etc/guacamole/user-mapping.xml


user-mapping.xmlの記載ルールですが、以下のようなものがあります。
<authorize username="user" password="password">:Guacamoleへのログインユーザ名とパスワード
<connection name="localhost ssh">:接続先につける名前
<protocol>ssh</protocol>:使用する接続プロトコル(ssh/vnc/rdp)
<param name="port">22</param>:接続に使用するポート番号
<param name="username">user01</param>:接続先に接続する際のユーザ名
<param name="password">01010101</param>:接続先に接続する際のパスワード

設定に関しては、公式ドキュメントを参照ください。
https://guacamole.apache.org/doc/1.4.0/gug/configuring-guacamole.html

[root@localhost guacamole]# vi user-mapping.xml 
[root@localhost guacamole]# cat user-mapping.xml 
<user-mapping>
    <authorize username="user" password="password">
        <connection name="localhost ssh">
            <protocol>ssh</protocol>
            <param name="hostname">localhost</param>
            <param name="port">22</param>
        </connection>
        <connection name="kubernetes newmaster1">
            <protocol>ssh</protocol>
            <param name="hostname">192.168.1.201</param>
            <param name="port">22</param>
            <param name="username">user01</param>
            <param name="password">01010101</param>
            <param name="ignore-cert">true</param>
        </connection>
        <connection name="kubernetes newworker1">
            <protocol>ssh</protocol>
            <param name="hostname">192.168.1.211</param>
            <param name="username">user01</param>
            <param name="password">02020202</param>
            <param name="ignore-cert">true</param>
        </connection>
        <connection name="kubernetes newworker2">
            <protocol>ssh</protocol>
            <param name="hostname">192.168.1.212</param>
            <param name="username">user03</param>
            <param name="password">03030303</param>
            <param name="ignore-cert">true</param>
        </connection>
        <connection name="CentOS7 192.168.1.185">
            <protocol>ssh</protocol>
            <param name="hostname">192.168.1.185</param>
            <param name="username">root</param>
            <param name="password">abcdefgh</param>
        </connection>
    </authorize>
</user-mapping>


Apache Guacamoleの起動
Guacamole(guacd)とtomcatを起動します。

[root@localhost ~]# systemctl start guacd
[root@localhost ~]# systemctl start tomcat
[root@localhost ~]# systemctl status guacd
● guacd.service - Guacamole proxy daemon
   Loaded: loaded (/usr/lib/systemd/system/guacd.service; enabled; vendor preset: disabled)
   Active: active (running) since 水 2023-02-08 19:52:58 JST; 14s ago
     Docs: man:guacd(8)
 Main PID: 20089 (guacd)
   CGroup: /system.slice/guacd.service
           └─20089 /usr/sbin/guacd -f

 2月 08 19:52:58 localhost.localdomain systemd[1]: Stopped Guacamole proxy daemon.
 2月 08 19:52:58 localhost.localdomain systemd[1]: Started Guacamole proxy daemon.
 2月 08 19:52:58 localhost.localdomain guacd[20089]: Guacamole proxy daemon (guacd) version 1.4.0 started
 2月 08 19:52:58 localhost.localdomain guacd[20089]: guacd[20089]: INFO:        Guacamole proxy daemon (guacd) version 1....arted
 2月 08 19:52:58 localhost.localdomain guacd[20089]: guacd[20089]: INFO:        Listening on host ::1, port 4822
 2月 08 19:52:58 localhost.localdomain guacd[20089]: Listening on host ::1, port 4822
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]# systemctl status tomcat
● tomcat.service - Apache Tomcat Web Application Container
   Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; vendor preset: disabled)
   Active: active (running) since 水 2023-02-08 19:53:02 JST; 13s ago
 Main PID: 20103 (java)
   CGroup: /system.slice/tomcat.service
           └─20103 /usr/lib/jvm/jre/bin/java -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory -cla...

 2月 08 19:53:06 localhost.localdomain server[20103]: 情報: サービス Catalina を起動します
 2月 08 19:53:06 localhost.localdomain server[20103]: 2 08, 2023 7:53:06 午後 org.apache.catalina.core.StandardEngine sta…nternal
 2月 08 19:53:06 localhost.localdomain server[20103]: 情報: Starting Servlet Engine: Apache Tomcat/7.0.76
 2月 08 19:53:06 localhost.localdomain server[20103]: 2 08, 2023 7:53:06 午後 org.apache.catalina.startup.HostConfig deployWAR
 2月 08 19:53:06 localhost.localdomain server[20103]: 情報: Webアプリケーションアーカイブ /var/lib/tomcat/webapps/guacamo…します
 2月 08 19:53:12 localhost.localdomain server[20103]: 2 08, 2023 7:53:12 午後 org.apache.catalina.startup.TldConfig execute
 2月 08 19:53:12 localhost.localdomain server[20103]: 情報: At least one JAR was scanned for TLDs yet contained no TLDs. …n time.
 2月 08 19:53:14 localhost.localdomain server[20103]: 19:53:14.067 [localhost-startStop-1] INFO  o.a.g.environment.LocalE...ole".
 2月 08 19:53:14 localhost.localdomain server[20103]: 19:53:14.255 [localhost-startStop-1] ERROR o.a.g.GuacamoleServletCo...xist.
 2月 08 19:53:14 localhost.localdomain server[20103]: 19:53:14.258 [localhost-startStop-1] INFO  o.a.g.rest.auth.HashToke...vity.
Hint: Some lines were ellipsized, use -l to show in full.


journalctl -u tomcat -fとすれば、起動時に何が起こっているか詳細に確認することができます。

[root@localhost guacamole]# journalctl -u tomcat -f
-- Logs begin at 火 2023-01-31 19:43:15 JST. --
 2月 10 21:04:08 localhost.localdomain server[15499]: 2 10, 2023 9:04:08 午後 org.apache.coyote.AbstractProtocol destroy
 2月 10 21:04:08 localhost.localdomain server[15499]: 情報: Destroying ProtocolHandler ["ajp-bio-8009"]
 2月 10 21:04:08 localhost.localdomain systemd[1]: Stopped Apache Tomcat Web Application Container.
 2月 10 21:04:08 localhost.localdomain systemd[1]: Started Apache Tomcat Web Application Container.
 2月 10 21:04:08 localhost.localdomain server[15651]: Java virtual machine used: /usr/lib/jvm/jre/bin/java
 2月 10 21:04:08 localhost.localdomain server[15651]: classpath used: /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar
 2月 10 21:04:08 localhost.localdomain server[15651]: main class used: org.apache.catalina.startup.Bootstrap
 2月 10 21:04:08 localhost.localdomain server[15651]: flags used: -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory
 2月 10 21:04:08 localhost.localdomain server[15651]: options used: -Dcatalina.base=/usr/share/tomcat -Dcatalina.home=/usr/share/tomcat -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat/temp -Djava.util.logging.config.file=/usr/share/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 2月 10 21:04:08 localhost.localdomain server[15651]: arguments used: start
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: Server version:        Apache Tomcat/7.0.76
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: Server built:          Nov 16 2020 16:51:26 UTC
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: Server number:         7.0.76.0
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: OS Name:               Linux
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: OS Version:            3.10.0-1160.el7.x86_64
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: Architecture:          amd64
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: Java Home:             /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b08-1.el7_9.x86_64/jre
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: JVM Version:           1.8.0_362-b08
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: JVM Vendor:            Red Hat, Inc.
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: CATALINA_BASE:         /usr/share/tomcat
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: CATALINA_HOME:         /usr/share/tomcat
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: Command line argument: -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: Command line argument: -Dcatalina.base=/usr/share/tomcat
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: Command line argument: -Dcatalina.home=/usr/share/tomcat
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: Command line argument: -Djava.endorsed.dirs=
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: Command line argument: -Djava.io.tmpdir=/var/cache/tomcat/temp
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: Command line argument: -Djava.util.logging.config.file=/usr/share/tomcat/conf/logging.properties
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.startup.VersionLoggerListener log
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 2月 10 21:04:12 localhost.localdomain server[15651]: 2 10, 2023 9:04:12 午後 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
 2月 10 21:04:12 localhost.localdomain server[15651]: 情報: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
 2月 10 21:04:13 localhost.localdomain server[15651]: 2 10, 2023 9:04:13 午後 org.apache.coyote.AbstractProtocol init
 2月 10 21:04:13 localhost.localdomain server[15651]: 情報: Initializing ProtocolHandler ["http-bio-8080"]
 2月 10 21:04:13 localhost.localdomain server[15651]: 2 10, 2023 9:04:13 午後 org.apache.coyote.AbstractProtocol init
 2月 10 21:04:13 localhost.localdomain server[15651]: 情報: Initializing ProtocolHandler ["ajp-bio-8009"]
 2月 10 21:04:13 localhost.localdomain server[15651]: 2 10, 2023 9:04:13 午後 org.apache.catalina.startup.Catalina load
 2月 10 21:04:13 localhost.localdomain server[15651]: 情報: Initialization processed in 3874 ms
 2月 10 21:04:13 localhost.localdomain server[15651]: 2 10, 2023 9:04:13 午後 org.apache.catalina.core.StandardService startInternal
 2月 10 21:04:13 localhost.localdomain server[15651]: 情報: サービス Catalina を起動します
 2月 10 21:04:13 localhost.localdomain server[15651]: 2 10, 2023 9:04:13 午後 org.apache.catalina.core.StandardEngine startInternal
 2月 10 21:04:13 localhost.localdomain server[15651]: 情報: Starting Servlet Engine: Apache Tomcat/7.0.76
 2月 10 21:04:13 localhost.localdomain server[15651]: 2 10, 2023 9:04:13 午後 org.apache.catalina.startup.HostConfig deployWAR
 2月 10 21:04:13 localhost.localdomain server[15651]: 情報: Webアプリケーションアーカイブ /var/lib/tomcat/webapps/guacamole.war を配備します
 2月 10 21:04:21 localhost.localdomain server[15651]: 2 10, 2023 9:04:21 午後 org.apache.catalina.startup.TldConfig execute
 2月 10 21:04:21 localhost.localdomain server[15651]: 情報: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
 2月 10 21:04:23 localhost.localdomain server[15651]: 21:04:22.948 [localhost-startStop-1] INFO  o.a.g.environment.LocalEnvironment - GUACAMOLE_HOME is "/etc/guacamole".
 2月 10 21:04:23 localhost.localdomain server[15651]: 21:04:23.539 [localhost-startStop-1] INFO  o.a.g.GuacamoleServletContextListener - Read configuration parameters from "/etc/guacamole/guacamole.properties".
 2月 10 21:04:23 localhost.localdomain server[15651]: 21:04:23.569 [localhost-startStop-1] INFO  o.a.g.rest.auth.HashTokenSessionMap - Sessions will expire after 60 minutes of inactivity.
 2月 10 21:04:25 localhost.localdomain server[15651]: 21:04:25.896 [localhost-startStop-1] INFO  o.a.g.t.w.WebSocketTunnelModule - Loading JSR-356 WebSocket support...
 2月 10 21:04:31 localhost.localdomain server[15651]: 2 10, 2023 9:04:31 午後 org.apache.catalina.startup.HostConfig deployWAR
 2月 10 21:04:31 localhost.localdomain server[15651]: 情報: Deployment of web application archive /var/lib/tomcat/webapps/guacamole.war has finished in 18,183 ms
 2月 10 21:04:31 localhost.localdomain server[15651]: 2 10, 2023 9:04:31 午後 org.apache.catalina.startup.HostConfig deployDirectory
 2月 10 21:04:31 localhost.localdomain server[15651]: 情報: Webアプリケーションディレクトリ /var/lib/tomcat/webapps/ROOT を配備します
 2月 10 21:04:32 localhost.localdomain server[15651]: 2 10, 2023 9:04:32 午後 org.apache.catalina.startup.TldConfig execute
 2月 10 21:04:32 localhost.localdomain server[15651]: 情報: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
 2月 10 21:04:32 localhost.localdomain server[15651]: 2 10, 2023 9:04:32 午後 org.apache.catalina.startup.HostConfig deployDirectory
 2月 10 21:04:32 localhost.localdomain server[15651]: 情報: Deployment of web application directory /var/lib/tomcat/webapps/ROOT has finished in 475 ms
 2月 10 21:04:32 localhost.localdomain server[15651]: 2 10, 2023 9:04:32 午後 org.apache.catalina.startup.HostConfig deployDirectory
 2月 10 21:04:32 localhost.localdomain server[15651]: 情報: Webアプリケーションディレクトリ /var/lib/tomcat/webapps/examples を配備します
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TaglibUriRule body
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.TldConfig execute
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.HostConfig deployDirectory
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: Deployment of web application directory /var/lib/tomcat/webapps/examples has finished in 2,239 ms
 2月 10 21:04:34 localhost.localdomain server[15651]: 2 10, 2023 9:04:34 午後 org.apache.catalina.startup.HostConfig deployDirectory
 2月 10 21:04:34 localhost.localdomain server[15651]: 情報: Webアプリケーションディレクトリ /var/lib/tomcat/webapps/sample を配備します
 2月 10 21:04:35 localhost.localdomain server[15651]: 2 10, 2023 9:04:35 午後 org.apache.catalina.startup.TldConfig execute
 2月 10 21:04:35 localhost.localdomain server[15651]: 情報: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
 2月 10 21:04:35 localhost.localdomain server[15651]: 2 10, 2023 9:04:35 午後 org.apache.catalina.startup.HostConfig deployDirectory
 2月 10 21:04:35 localhost.localdomain server[15651]: 情報: Deployment of web application directory /var/lib/tomcat/webapps/sample has finished in 1,122 ms
 2月 10 21:04:35 localhost.localdomain server[15651]: 2 10, 2023 9:04:35 午後 org.apache.coyote.AbstractProtocol start
 2月 10 21:04:35 localhost.localdomain server[15651]: 情報: Starting ProtocolHandler ["http-bio-8080"]
 2月 10 21:04:35 localhost.localdomain server[15651]: 2 10, 2023 9:04:35 午後 org.apache.coyote.AbstractProtocol start
 2月 10 21:04:35 localhost.localdomain server[15651]: 情報: Starting ProtocolHandler ["ajp-bio-8009"]
 2月 10 21:04:35 localhost.localdomain server[15651]: 2 10, 2023 9:04:35 午後 org.apache.catalina.startup.Catalina start
 2月 10 21:04:35 localhost.localdomain server[15651]: 情報: Server startup in 22705 ms
 2月 10 21:04:59 localhost.localdomain server[15651]: 21:04:59.163 [http-bio-8080-exec-6] INFO  o.a.g.r.auth.AuthenticationService - User "guacamole_user" successfully authenticated from 192.168.1.132.
 2月 10 21:05:02 localhost.localdomain server[15651]: 21:05:02.096 [http-bio-8080-exec-7] INFO  o.a.g.tunnel.TunnelRequestService - User "guacamole_user" connected to connection "localhost ssh".
 2月 10 21:05:13 localhost.localdomain server[15651]: 21:05:13.062 [http-bio-8080-exec-7] INFO  o.a.g.tunnel.TunnelRequestService - User "guacamole_user" disconnected from connection "localhost ssh". Duration: 10961 milliseconds
 2月 10 21:05:16 localhost.localdomain server[15651]: 21:05:16.285 [http-bio-8080-exec-9] INFO  o.a.g.tunnel.TunnelRequestService - User "guacamole_user" connected to connection "localhost ssh".
 2月 10 21:05:23 localhost.localdomain server[15651]: 21:05:23.363 [http-bio-8080-exec-9] INFO  o.a.g.tunnel.TunnelRequestService - User "guacamole_user" disconnected from connection "localhost ssh". Duration: 7078 milliseconds



ブラウザからアクセスしてみる
http://GuacamoleのIPアドレス:8080/guacamole/にアクセスします。
設定ファイル(user-mapping.xml)に記載したユーザ名とパスワードを使います。


ログイン後は、登録された接続先一覧が表示されます。


接続先をクリックすると、接続されます。
※接続先に使用するユーザ名とパスワードを設定していない場合、認証を求められる。


切断するときは、"exit"します。


一度接続したものは、履歴として記録されます。



おわりに
今回はシンプルなGuacamoleの使い方を紹介しましたが、
管理者権限で接続先やユーザを管理したり、ログイン時の認証にデータベースを使ったり、ログイン時の通信をhttpsにしたりと色々と試すことがありそうです。

Opensourcetech by Takahiro Kujirai