3.0. Set up a remote host
Hints
If you already have a remote host which has a configured OpenSSH
server, you can skip this step. (The following exercices will use password-based authentication, but the SSHLibrary
supports key-based authentication, too.)
The prerequisite for the next steps is to have an already installed and configured Docker Engine.
We are going to use openssh-server container from LinuxServer.io team to quickly set up a limited and sandboxed environment that we can ssh into.
Create an openssh-server
based container with to following command.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Check that your container is created.
1 |
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
95313a9f85f1 linuxserver/openssh-server "/init" 3 minutes ago Created openssh-server-for-robot
Start the container.
1 |
|
Try to access it using ssh.
1 |
|
The authenticity of host '[localhost]:2222 ([127.0.0.1]:2222)' can't be established.
ECDSA key fingerprint is SHA256:x4bTJ6bxYJEp4zMk9sQMYhK8ou8oQrm6aCsKaBnj+2o.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
You should see the following promt.
Welcome to OpenSSH Server
openssh-server-for-robot:~$
That is it, you are good to go!
Last update: June 22, 2020