20.08.2017

CoreOS: How to login via ssh (default password?!)

After the installation of a coreos you want to login via ssh (because of wrong localization inside your virtualbox/vmware console and no client tools installed (copy/paste not working, etc...)?
If you ask your preferred search engine, you will get many answers that there is not default password...
(Of course! The idea behind containers and container schedulers is, that everything works automatically and typing passwords does not fit in this mantra).

But no worries, only 4 steps are needed to get a login via ssh:

  1. on your laptop
    1. $ ssh-keygen
      Generating public/private rsa key pair.
      Enter file in which to save the key (/home/schroff/.ssh/id_rsa):
      Enter passphrase (empty for no passphrase):
      Enter same passphrase again:
      Your identification has been saved in /home/schroff/.ssh/id_rsa.
      Your public key has been saved in /home/schroff/.ssh/id_rsa.pub.
      The key fingerprint is:
      SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxx schroff@zerberus
      The key's randomart image is:
      +---[RSA 2048]----+
      xxxxxx
      +----[SHA256]-----+
    2. cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
  2. inside the coreos vm
    1.  scp schroff@:/.ssh/authorized_keys /home/core/.ssh
      schroff@xxxxxxx's password:
      authorized_keys                                               100%  398     0.4KB/s   00:00   
  3. on your laptop
    1. ssh core@
With executing step 3.1 the login into the coreos machine works without a password, BUT ONLY up to the next reboot, because the home-directory is a tmpfs filesystem, which looses its content with each reboot...
(Although you have to clean up your known hosts file, because the machine starts up with a new ssh key.)

1 Kommentar:

  1. We stumbled over here by a diffrerent web address and thought I might check things
    out. I like what I ssee so i aam just following
    you. Look forward to looking into your web page repeatedly.

    AntwortenLöschen