Score:1

Preconfiguring ssh password for server installer

us flag

I am trying to install Ubuntu Server on a device on which the available HDMI port broke down, so I can't connect a display whatsoever. I read in the docs (here) that it was possible to connect to the installer over SSH. I managed to boot into the Installer on my device, and found the IP address with the corresponding open ssh port. The problem is, that I don't know the password to use and I can't read it from the screen either as is intended if I understood it correctly. Some online resources suggested it might be ubuntu but that was not the case.

Is there a way to set the key/password beforehand or modify it?

I already found this question about pretty much the same problem, yet it did not contain an answer I can use.

Score:2
jp flag

If you are using the "live-server" installer (subiquity) then the default settings will create a user named installer with a random password. The installer user can be used to access the installer TUI by SSH.

Depending on the version of subiquity the randomly generated password is printed to the screen or is available under the Help menu.

The installer user is created by cloud-init when the installer boots. By changing the cloud-init configuration it is possible to set the password or to add SSH Key(s) for the installer user to something known. There are a couple of ways to configure cloud-init.

Use Autoinstall

I have been able to set the installer password by using an autoinstall file. The file has content like the following to set a password and set an SSH key.

#cloud-config
autoinstall:
...
# set password to r00tme
chpasswd:
    expire: false
    list:
        - installer:$6$.c38i4RIqZeF4RtR$hRu2RFep/.6DziHLnRqGOEImb15JT2i.K/F9ojBkK/79zqY30Ll2/xx6QClQfdelLe.ZjpeVYfE8xBBcyLspa/
ssh_authorized_keys:
    - ssh-rsa FILLINYOUROWNKEYHERE 

Modify the ISO

I have not done this, but you could try modifying the ISO. The installer user setup is configured in the /etc/cloud.cfg file. You could modify this file to define a password or SSH key.

See Also

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.