1. What to do?

  • First we create an Oracle VM instance

  • Afterward we will login into the Oracle VM instance (called oravm) per ssh-session w/o using username and password.

We have to use a ssh.key-pair. The public key must be transferred into the .ssh-folder on the remote server.

ssh overview
  1. create local ssh-key-pair

  2. create an Oracle VM instance (oravm)

  3. create a config-file in .ssh

  4. login into VM instance

2. Create a local ssh - key pair for HTL Leonding

We create an own key pair for our work in HTL Leonding college

  • htl_key

  • htl_key.pub

Command for generating the ssh key pair
cd ~/.ssh
ssh-keygen -t ecdsa
We have to give a name to the key pair → htl_key
Generating public/private ecdsa key pair.
Enter file in which to save the key (/home/stuetz/.ssh/id_ecdsa): htl_key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in htl_key
Your public key has been saved in htl_key.pub
The key fingerprint is:
SHA256:9SQVFDAdo0u6ILR/KEWRHrs3t9gvo3C9T69Jo9+rMus
stuetz@ubuntu-linux-22-04-desktop
The key's randomart image is:
+---[ECDSA 256]---+
|      ..  o+B+   |
|      o.   +..   |
|    ...o  = .    |
|   . oo  + =     |
|    o o.S . .    |
|     +.ooo.      |
|    . +.+=..+    |
|     . +. B= =   |
|        .oEXBo+. |
+----[SHA256]-----+

3. Create an Oracle VM Instance in Oracle Cloud

Click here for detailed installation instructions
Login into Oracle Cloud

oracle cloud 001

oracle cloud 002

oracle cloud 003

Choose "Create a VM Instance"

oracle cloud 004

oracle cloud 004a

Edit "Placement and hardware"

oracle cloud 005

Change Image

oracle cloud 005a

Choose Ubuntu Minimal

oracle cloud 006

Upload the public key from your local .ssh-folder

oracle cloud 007

Upload the public key of the formerly created key pair and click the Create - button

oracle cloud 007a

Wait a couple of minutes until the status becomes RUNNING

oracle cloud 008

3.1. Create a local ssh-config-File

  1. change dir to .ssh in your home directory

    cd ~/.ssh
  2. open an editor to create a file config

    nano config
  3. configure the ssh-access to oravm

    Host <choose a name for your remote server>
         Hostname <public ip-address from oravm>
         User <user of the remote server>
         IdentityFile <local private key>
    Example
    Host oravm
         Hostname 144.24.189.164
         User ubuntu
         IdentityFile ~/.ssh/htl_key

4. Login First Time

ssh <host-alias-from-config-file>
Example
ssh oravm
Result
Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-1037-oracle x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

 * Introducing self-healing high availability clusters in MicroK8s.
   Simple, hardened, Kubernetes for production, from RaspberryPi to DC.

     https://microk8s.io/high-availability

This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

To restore this content, you can run the 'unminimize' command.

0 updates can be installed immediately.
0 of these updates are security updates.

Last login: Tue Mar 16 13:44:59 2021 from 193.170.159.99
ubuntu@instance-20210316-1435:~$
  • to use one command as root: sudo <command>

  • to login as root-user: sudo -i

  • to update your system:

    sudo apt update && sudo apt -y dist-upgrade && sudo apt autoremove

5. Verbindung in Filezilla einrichten

  • Filezilla:

you have to use the private key

ssh in filezilla 002

6. Install JDK

There are different options:

  • openjdk

  • Oracle JDK

  • adoptium / temurin

  • …​

We choose temurin:

First login
ssh oravm
add the package manager sources for adoptopenjdk and install the jdk
# install missing dependencies
sudo apt install -y wget apt-transport-https

# install the gpg key
mkdir -p /etc/apt/keyrings
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo tee /etc/apt/keyrings/adoptium.asc

# make an entry in the package manager sources - file
sudo echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list

# update the package lists to get the adoptopenjdk packages entries
sudo apt update

# install the jdk
sudo apt install -y temurin-17-jdk

# now check the java version
java -version

# now check the java-compiler version
javac -version

7. Install Docker

sudo apt-get update

sudo apt-get install \
    ca-certificates \
    curl \
    gnupg

sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update

sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

docker --version
docker compose version