Not able to configure SSH from windows

  • I can't seem to get SSH working from windows with puttygen. Here's my process:


    I've created openmediavault user User, given it a home directory (/home/User), created the .ssh directory in home.


    I use puttygen to create a private and public key pair (sshremote and sshremote.pub). I put them both in the .ssh directory.


    I make sure my user is in ssh and users, and I try to run ssh-keygen -e -f on the sshremote.pub, but even after entering the passphrase I set in puttygen it says "load failed." And when I try to copy/paste the ssh key into the WebGUI in OMV, I get an error that it's not in the right format.


    Where am I going wrong?

  • And when I try to copy/paste the ssh key into the WebGUI in OMV, I get an error that it's not in the right format.


    Conversion -> Export OpenSSH Key.



    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

    • Offizieller Beitrag

    I put them both in the .ssh directory.


    The private key never leaves the generation location btw.


    On the other side there seems to be a bug, i even try adding the one of the same keys I already have in config.xml, and still fails.


    I try to run omv-mkconf with the current configuration no keys added


    Code
    run-parts: failed to exec /usr/share/openmediavault/mkconf/ssh.d/20authorized_keys: Exec format error
    run-parts: /usr/share/openmediavault/mkconf/ssh.d/20authorized_keys exited with return code 1
    • Offizieller Beitrag

    @lh1983 what you're doing in the beginning was correct, but as I warned your before private key never leaves the creation point.
    From the puttygen public key field copy and paste into a text file in omv. From omv terminal export it to rfc4716 format, select copy and paste to the user key field


    Unfortunately there is a hug in the mkconf script.
    You can fix it yourself by editing this file /usr/share/openmediavault/mkconf/ssh.d/20 Authorized_keys
    And delete the first empty line before #!/bin/bash

  • Here's what I get when I open 20authorized_keys in a text editor:



    I don't see an empty line before #!/bin/sh


    I followed the rest of your earlier directions and I'm still getting the "server refused our key."

    • Offizieller Beitrag

    How come you don't. You even pasted here with two empty lines. Use nano in the terminal, if there is no empty line then is fine
    Use ctrl+K to delete lines. Delete the first one before bin/bash
    Ctrl+x to save
    Don't use the export key button in puttygen. Use the public key field to select and copy to a text file. Then in omv convert it to rfc4716 using ssh-keygen -e -f textfile


    paste the output in omv user management

  • OK OK OK! Now we are getting somewhere.


    that seems to have fixed it.


    New question: I sometimes use my laptop or my other desktop to administer my OMV box. How do I let them SSH in as well? Create separate public keys for all of those computers, or put a copy of the private key file on each device?

  • Security wise each would have their own Key Pair. That way you could revoke access for a specific key in case thats needed.


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!