7

I just installed Ubuntu Core 16 on a Raspberry Pi 2. Before install, I uploaded my ssh key for one of my computers to my Ubuntu SSO account. After installation I had no problems connecting to the Pi using my key and Ubuntu SSO Username. Then I wanted to be able to connect to the Pi from another machine and I generated a new key which I then added to the same account.

The problem is that logging in using this second key does not work.

If I take a look at my authorized_keys file on the Pi, it contains only the first key which explains why login from the second machine doesn't work. How do I get my second key in there? I guess I could do it manually but it seems like the wrong way to do it, given the cloud integration and all.

popstr
  • 173
  • 6

1 Answers1

5

The SSH keys are imported once during console-conf into your user's home directory ~/.ssh/. Therefore, if you mount the writable partition on a different Linux machine you can manually append the missing SSH public key(s) to /writable/user-data/username/.ssh/authorized_keys.

This worked on a WDLabs Nextcloud Box running Ubuntu Core 16 and Nextcloud 11.

Lucas
  • 685