SSH key configuration not working

  • Hello all


    I am trying to add private key to my server, since I need the good security on SSH. I followed this guide:
    https://sites.google.com/site/…howto/generate-an-ssh-key

    I tried different times, but no success. When I have completed the guide, my putty client says that the connection was refused (Server sent publickey).
    The Authentication log on the server says the same thing.
    This is my OMV version: http://puu.sh/e1gfp/60163932a5.png


    I checked that the key was added to the authenticated keys file and enverything there is OK.
    I checked the permissions and they are fine.
    I tried to turn on and off the SSH service from the WebGUI but with no luck.
    If its not much to ask, I need a little help here.


    I had a previous server, an Ubuntu Headless Server, where I had 4096 bit private keys on and it worked fine.
    I needed new server hardware and needed good dynamic software RAID, so I found OMV and I LOVE IT!
    The difference between Ubuntu CLI and Debian CLI is not very big and I am starting to like Debian more and more.
    I just cant get those keys to work.
    If you need more information to help, please let me know :)

  • Thanks for the answer.
    I am using root and I am using /.ssh/authorized_keys.
    Going to double-check that just to be shure.

  • Is then /root/.ssh/authorized_key


    In that file you paste the PUBLIC KEY, not the private. The public key is usually formatted as one line string. So if you nano /root/.ssh/authorized_keys, you should get something like


    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAA much longer of course an in one line

  • Hmm. I am using puttygen to convert the key I get from the process to a private key, that I load into pagent and then I try to login.
    Should I try and generate the key with puttygen and put it into the servers authorized_keys?
    Is it better to do this via SSH or use the WebGUI?

  • The convert with puttygen to putty ppk format is fine. The generation from puttygen always gives me trouble, so I would avoid that.


    Disable the public key authentication in webui and enable password, login again delete the current pub keys, generate a new key pair inside omv, move pub to a authorized_keys and extract with winscp the private, convert it to ppk and use that one.


    Don't forget to go back to webUI to enable the key authentication and disable password.

  • When I open a new PuTTY terminal, I open a pre-configured session with my servers address and the non root user I created on the server.
    This time I opened a new terminal and used the root user to login and bang: "Authenticating with public key "imported-openssh-key" from agent".!
    So all this time, I've created the keys with the root user, but I did not use the root user to login with afterwards. I used the non root user I created in the web interface.


    So far so good. I just generated a new pair of 4096 keys with the root user and now I can't login with root.
    But I added the key to the non root user in the WebGUI and now I can log in with the user but not root.
    This is getting more and more wired. But I don't need to directly login as the root user. I need to login as my own non root and from there I can su to root if needed.


    So for what I need now, its working.
    Just at final question before I mark this as solved:
    If I added a key via the WebGUI, can I then remove the /.ssh/autherized_keys file from the server?
    Because I don't need to login as root from SSH, so theoretically removing that should not effect anything.
    I can see that the public key I added to my user in the WebGUI is still showing after I saved it. Is that normal?

  • I don't know what I am doing wrong, I use SSH all the time but I cannot login via ssh keys!


    Just generated new keys, new user, and I get pub key denied!!


    Not sure how to troubleshoot it


    password login is fine


    User is in SSH group and ssh is enabled as a service and running, Im baffled

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!