coreos / bugs

Issue tracker for CoreOS Container Linux
https://coreos.com/os/eol/
146 stars 30 forks source link

Doc needed for using my own ssh key #1327

Open crawford opened 9 years ago

crawford commented 9 years ago

Issue by hbrls


Senario:

I'd like to use both vagrant ssh and ssh core@10.2.0.101. By default, the former command uses ~/.vagrant.d/insecure_private_key while the latter uses ~/.ssh/id_rsa.

On a traditional OS, I would append id_rsa.pub to core@core-01's ~/.ssh/authorized_keys and all is fine. But CoreOS regenerate that file on reboot.

After research

  1. I'm now setting the ssh_authorized_keys directive in the cloud config file user-data following the coreos quickstart:

    cloud-config

    ssh_authorized_keys:

    • ssh-rsa AAAA... coreos: units: ...
  2. Then modify the Vagrantfile to tell vagrant ssh to use my own private key following vagrant doc

    config.ssh.insert_key = false config.ssh.private_key_path = ["~/.vagrant.d/insecure_private_key", "~/.ssh/id_rsa"]

1 is not in user-data.sample, and 2 is not in Vagrantfile. Am I on the right way? Can we elaborate on the docs?

AlexNPavel commented 7 years ago

We currently do not support non-vagrant ssh keys. However, we will be moving to Ignition for both providers soon (we already have for VirtualBox), so the ssh keys won't get reset constantly. We will close once we add the Ignition support for the VMWare provider.