SSH not allowed after reboot

  • Hullo and greetings!


    I have a small issue with SSH. Simply put, I am not permitted to SSH into the box upon rebooting.
    If I access the SSH configuration in the GUI after a reboot it is ticked properly.


    To solve it I have to untick it, save, and then tick/save it once more.
    Anyone else experiencing this and/or might be able to help me figure out what could be causing this? :)


    BR

  • How do I access the CLI if it is unchecked? Will it work if I SSH into the box, uncheck enable, save/apply and then give you the output of omv-showkey ssh?


    Gotcha!


    So, to clarify. Permit root login is always unchecked. Sorry for being vague. Issue is that I am refused to login with a user upon reboot. I have not tried with root, but guessing the result will be the same. If I try to SSH after reboot I get the following:
    ssh: connect to host 10.10.9.13 port 22: Connection refused


    So what I do is cycle the enable option in the SSH plugin and then it works.


    The output right now is:
    cat: /etc/openmediavault/config.xml: Permission denied



  • Ah, I read above wrong. I thought you said if it was unticked you could get into SSH.


    untick it save/apply
    tick it save/apply


    give results of:
    omv-showkey ssh


    I am looking to see if it is corrupted in the /etc/openmediavault/config.xml file

  • Well you should have "Permit root login" checked and then login as root if you want to do system stuff. If you login as another user you are unprivileged. That is why this user cannot get results of the cat /etc/openmediavault/config.xml command.


    If you want another user to be able to login via Putty/SSH you need to add them to the SSH group at:


    Access Rights Management/User/
    click on the user name to highlight it
    then click on edit
    scroll down the ssh group and put in a tick
    then click on save


    Then the user will be able to access via ssh but will be unprivileged.

  • The user is added to the correct group (I checked it again just to be sure hehe). I could switch to always using root, no problem, however the issue still persists.


    The user is able to login fine if I just cycle the enable option in the ssh plugin. It's just that upon rebooting it doesn't seem to recognize that I have enabled ssh at all.


    Edit:
    Below is the output for above command when run as root :)


    <ssh>
    <enable>1</enable>
    <port>22</port>
    <extraoptions></extraoptions>
    <passwordauthentication>1</passwordauthentication>
    <pubkeyauthentication>1</pubkeyauthentication>
    <permitrootlogin>0</permitrootlogin>
    <tcpforwarding>0</tcpforwarding>
    <compression>0</compression>
    </ssh>

  • Yes sir, with root aswell.


    This is what I did now. Ticked "Enable", ticked "Permit Root Login". Rebooted. And directly after reboot, see below:


    nmo@CYRUS ~> ssh nmo@10.10.9.13
    ssh: connect to host 10.10.9.13 port 22: Connection refused
    nmo@CYRUS ~> ssh root@10.10.9.13
    ssh: connect to host 10.10.9.13 port 22: Connection refused

  • Cycle it again and when you enable make sure tick is in Permit root login. Then edit this file and make sure there is a 1 here:


    /etc/openmediavault/config.xml


    Look for this section:


    <ssh>
    <enable>1</enable>
    <port>22</port>
    <extraoptions></extraoptions>
    <passwordauthentication>1</passwordauthentication>
    <pubkeyauthentication>1</pubkeyauthentication>
    <permitrootlogin>0</permitrootlogin>
    <tcpforwarding>0</tcpforwarding>
    <compression>0</compression>
    </ssh>


    You want to make sure this line has a 1 in it and save it:


    <permitrootlogin>1</permitrootlogin>

  • I did that (it was set correctly to 1). I saved the file. Rebooted and still the same issue, for some odd reason.


    I am not sure at all if this is relevant but this is from the logs directly after rebooting.


    From authentication log:
    sshd[2778]: Received signal 15; terminating.


    And that is all. Nothing about starting it. And this is after I cycle the "Enable" option in the ssh plugin.


    From authentication log:
    sshd[2837]: Server listening on :: port 22.
    sshd[2837]: Server listening on 0.0.0.0 port 22.


    My conclusion is that it doesn't activate after reboot for some weird reason.

  • Any news on this odd little matter? :)


    It's really not a big deal. I can always re-start SSH access in the WebGUI after every reboot, but it's just gnawing at me a little bit :D

  • If you have keyboard, monitor and mouse connected I would try this. You cannot do this via putty:


    update-rc.d -f ssh remove
    update-rc.d ssh defaults


    Then reboot to test.


    Well I feel kind of stupid now, tekkb. I tried above solution but it didn't work. Since I already had a monitor plugged in to the box I figured I might aswell monitor the boot and see if something weird happened. And well yeah... OpenVPN was starting and asking for username/password after Web GUI was initiated but before SSH was properly loaded.


    So me going in to the web gui and disabling/re-enabling SSH really didn't have ANYTHING to do with it. What happened when I disabled SSH a null statement got passed to the OpenVPN prompt which made the box boot up properly.


    To solve it I basically added my username/password for OpenVPN and voila, problem solved. The funny thing is that to "fix" this issue I've re-installed OMV on this freaking thing about 5 times now. And every single time I installed OpenVPN as a procedure I do everytime. I never figured it could have caused this nasty disturbing thing :D


    Thank you so much for your tolerance :)

Jetzt mitmachen!

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