/ tech

How Do I Login on a CoreOS Console?

Container Linux is based on CoreOS which is specifically designed to run as a cloud service infrastructure. Container Linux is almost always run on virtualized or "headless" hardware, which doesn't require access to a console. Changes to the kernel and Linux configuration are made while the system is running, when the system is rebooted they take effect.

Access to the Shell on Container Linux is only possible via SSH sessions which have SSH keys stored in the Linux configuration. This is very secure and a real pain if you need to do something from different computers. For instance, if the Mac I'm using is lost, stolen, broken or replaced, the SSH key is lost as well. There is no way to get into the system. Period. Furthermore, you can only put SSH keys into a CoreOS configuration when it is created, not afterward, because the "cloud-init" file used to create the Linux instance is only used once, then it's never referenced again.

If you have a 2nd computer, put it's SSH key into the system when creating the CoreOS instance. Then you'll have two computers available.

Let's say you want temporary access from another computer. This is possible using the CoreOS auto login feature. Note: this significantly reduces security, so don't keep this feature turned on unless you have good reason or don't care about the risk.

Enabling autologin on Droplet is easy. Just do this:

$ ssh core@useful-things.info
$ df | grep vda6
/dev/vda6          110576     64    101340   1% /usr/share/oem

This reveals that /dev/vda6 is mounted on /usr/share/oem. This filesystem is used to append parameters to the Linux command line (i.e. /proc/cmdline), via the grub.cfg in this directory.

Add the following line to /usr/share/oem/grub.cfg:

$ sudo vi /usr/share/oem/grub.cfg

set linux_append="coreos.autologin=tty1"

Stop your container(s), i.e.:

$ docker stop ghost.app

Then reboot.

$ sudo reboot

When the system comes up, "coreos.autologin=tty1" will be supplied to the kernel. You can now login to the Droplet's console.

To login to the Droplet's console, do this:

  1. Login to DigitalOcean.com
  2. Select the Droplet
  3. Click on the Console icon

You will then be presented with a console with the user "core" already logged in.

How Do I Login on a CoreOS Console?
Share this