Hi everyone, every time I setup a Pi project server I have a hard time since I can only access that device from the computer where I created the image since I add the SSH key during setup, but I would like to be able to ssh from my android and my other laptop in case I’m out on the road and away from home.

How can I add the other keys for the other devices to a single Pi without using the user name and password as this is also given me problems because ssh wants to try using keys and if it does not find them it just fails instead of asking me to enter the password (also, because it’s not really safe).

  • @ferngully
    link
    2
    edit-2
    8 months ago

    Debian has a package ssh-import-id which you can then run ssh-import-id-gh $githubUsername and it will ingest all the public keys you’ve put in GitHub. Should be able to easily add it to the cloud-init.yaml but I just always install and run this first.

    You can also just copy the keys to the install when you are imaging the SD card.

    Or use Ansible.