Results 1 to 6 of 6

Thread: Having Problems Importing New SSH Key

  1. #1
    Join Date
    Jul 2024
    Beans
    2

    Having Problems Importing New SSH Key

    I am new to Ubuntu. I installed Ubuntu Core 32 on a Raspberry Pi 3b. When I booted the Pi with Ubuntu Core for the first time, it went though a setup. I connected to my Wi-Fi and the next step was to import the Public key from my account at "login.ubuntu.com". I generated 4096 bit public and private keys using Putty Key Gen and saved them to my hard drive. I can't figure out how to import the new public key. The comments read "Insert the contents of your public key (usually ~/.ssh/id_rsa.pub, ~/.ssh/id_dsa.pub, ~/.ssh/id_ecdsa.pub or ~/.ssh/id_ed25519.pub)." and "Note: Only SSH v2 keys are supported." If the files are stored on my Windows PC, what goes in the text box? I've tried entering the file path to the public key and copying and pasting the key contents via notepad but get "Invalid SSH key type:"

    Thank you for taking the time to read this.

  2. #2
    currentshaft Guest

    Re: Having Problems Importing New SSH Key

    ssh-copy-id pi@<ip address of raspberry pi>

  3. #3
    Join Date
    Mar 2010
    Location
    Been there, meh.
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Having Problems Importing New SSH Key

    The comments assume you are using Unix or Linux as your workstation.

    I haven't used PuTTY in a long time, but I do recall that the format PuTTY keys used were non-standard.

    However, the built-in ssh in Win10 and Win11 comes with ssh-keygen.exe and you can create standard keys using it. Sadly, ssh-copy-id.exe is not part of MS-Windows, so you get to manually copy the public key to the Linux box.

    I know nothing of "importing a new key".
    The typical way is to create a new key on the client machine, then copy the public-key part to teh remote system.
    Code:
    # Step 1:  Run on the client as the normal user:
       $ ssh-keygen -t ed25519
    
    # Step 2:  Run from the client to the server:
       $ ssh-copy-id -i ~/.ssh/id_ed25519.pub username@remote
    That's it. If you want to have different keys for different remote systems, just run keygen with a different -i filename specified.

    I've never used Ubuntu Core. I don't like the idea of someone else being between my computers and me. I suppose if you've decided to run Ubuntu Core, then there are specific reasons why that choices was made.

    Don't know how much any of this helps or even if it does. For how to do things the PuTTY way, I suspect you'll need to read the PuTTY documentation. If you are on a Linux workstation, there's little reason to use putty. Just use any terminal program you like with ssh directly. The ~/.ssh/config file can make that really, really, convenient by filling in any specific settings or/and a different identity, as needed. Further, the ~/.ssh/config file is used by all ssh-based tools on the system, so any settings there apply to all the tools you might use.

  4. #4
    Join Date
    Jul 2024
    Beans
    2

    Re: Having Problems Importing New SSH Key

    Unfortunately, I can't copy the key to the remote system as I haven't gotten far enough through the configuration wizard to create the root password. I have to upload the keys to create the root password. The Wizard will pull the public key from my ubuntu.com account but I can't figure out how to upload it to Ubuntu.com.

  5. #5
    currentshaft Guest

    Re: Having Problems Importing New SSH Key

    Quote Originally Posted by wyred451 View Post
    Unfortunately, I can't copy the key to the remote system as I haven't gotten far enough through the configuration wizard to create the root password. I have to upload the keys to create the root password. The Wizard will pull the public key from my ubuntu.com account but I can't figure out how to upload it to Ubuntu.com.
    You don't need the root password for this.

  6. #6
    Join Date
    May 2010
    Beans
    3,498

    Re: Having Problems Importing New SSH Key

    your SSH key is used by your user, not root.
    You will also need to run the below on the system you are connecting to
    Code:
    mkdir ~/.ssh
    chmod 700 ~/.ssh
    touch ~/.ssh/authorized_keys
    chmod 600 ~/.ssh/authorized_keys
    You can then paste your public key into ~/.ssh/authorized_keys

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •