After renaming host, ssh still works but ssh service running shows red in dashboard.

  • Hi all,


    I've had to rename my OMV (a Pi4) and everything still works fine.

    However I noticed that:

    1. the SSH service running indicator shows red

    2. When I disable the ssh service via the OMV web gui and save the settings it gives the following error:


    Error #0:

    OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; omv-salt deploy run ssh 2>&1' with exit code '1': Pi4NASDocker:

    ----------

    ID: remove_ssh_authorized_keys

    Function: file.directory

    Name: /var/lib/openmediavault/ssh/authorized_keys

    Result: True

    Comment: Files cleaned from directory /var/lib/openmediavault/ssh/authorized_keys

    Started: 09:49:28.424985

    Duration: 4.701 ms

    Changes:

    ----------

    /var/lib/openmediavault/ssh/authorized_keys/idimou:

    ----------

    removed:

    Removed due to clean

    removed:

    - /var/lib/openmediavault/ssh/authorized_keys/idimou

    ----------

    ID: create_ssh_authorized_key_file_idimou

    Function: file.managed

    Name: /var/lib/openmediavault/ssh/authorized_keys/idimou

    Result: True

    Comment: File /var/lib/openmediavault/ssh/authorized_keys/idimou updated

    Started: 09:49:28.430010

    Duration: 8.317 ms

    Changes:

    ----------

    diff:

    New file

    user:

    idimou

    ----------

    ID: configure_ssh_sshd_config

    Function: file.managed

    Name: /etc/ssh/sshd_config

    Result: True

    Comment: File /etc/ssh/sshd_config is in the correct state

    Started: 09:49:28.438630

    Duration: 143.579 ms

    Changes:

    ----------

    ID: start_ssh_service

    Function: service.running

    Name: ssh

    Result: False

    Comment: Job for ssh.service failed because the control process exited with error code.

    See "systemctl status ssh.service" and "journalctl -xe" for details.

    Started: 09:49:28.611685

    Duration: 231.578 ms

    Changes:


    Summary for Pi4NASDocker

    ------------

    Succeeded: 3 (changed=2)

    Failed: 1

    ------------

    Total states run: 4

    Total run time: 388.175 ms in /usr/share/php/openmediavault/system/process.inc:182

    Stack trace:

    #0 /usr/share/php/openmediavault/engine/module/serviceabstract.inc(60): OMV\System\Process->execute()

    #1 /usr/share/openmediavault/engined/rpc/config.inc(167): OMV\Engine\Module\ServiceAbstract->deploy()

    #2 [internal function]: Engined\Rpc\Config->applyChanges(Array, Array)

    #3 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)

    #4 /usr/share/php/openmediavault/rpc/serviceabstract.inc(149): OMV\Rpc\ServiceAbstract->callMethod('applyChanges', Array, Array)

    #5 /usr/share/php/openmediavault/rpc/serviceabstract.inc(588): OMV\Rpc\ServiceAbstract->OMV\Rpc\{closure}('/tmp/bgstatusWX...', '/tmp/bgoutputxp...')

    #6 /usr/share/php/openmediavault/rpc/serviceabstract.inc(159): OMV\Rpc\ServiceAbstract->execBgProc(Object(Closure))

    #7 /usr/share/openmediavault/engined/rpc/config.inc(189): OMV\Rpc\ServiceAbstract->callMethodBg('applyChanges', Array, Array)

    #8 [internal function]: Engined\Rpc\Config->applyChangesBg(Array, Array)

    #9 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)

    #10 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('applyChangesBg', Array, Array)

    #11 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('Config', 'applyChangesBg', Array, Array, 1)

    #12 {main}



    It seems to remember the old hostname "Pi4NASDocker" and fail to remove a certificate that I had removed after renaming the host.

    >> Any ideas on how I can resolve this?


    Giannis


    PS:

    systemctl status ssh.service returns:


    ● ssh.service - OpenBSD Secure Shell server

    Loaded: loaded (/lib/systemd/system/ssh.service; disabled; vendor preset: enabled)

    Active: failed (Result: exit-code) since Mon 2020-08-31 09:49:28 EEST; 28min ago

    Docs: man:sshd(8)

    man:sshd_config(5)

    Process: 4882 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)

    Process: 4883 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255/EXCEPTION)

    Main PID: 4883 (code=exited, status=255/EXCEPTION)


    Aug 31 09:49:28 Pi48 sshd[4882]: /etc/ssh/sshd_config line 22: Unsupported option UsePAM

    Aug 31 09:49:28 Pi48 sshd[4882]: Could not load host key: /etc/ssh/ssh_host_ed25519_key

    Aug 31 09:49:28 Pi48 sshd[4883]: /etc/ssh/sshd_config line 22: Unsupported option UsePAM

    Aug 31 09:49:28 Pi48 sshd[4883]: Could not load host key: /etc/ssh/ssh_host_ed25519_key

    Aug 31 09:49:28 Pi48 sshd[4883]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.

    Aug 31 09:49:28 Pi48 sshd[4883]: error: Bind to port 22 on :: failed: Address already in use.

    Aug 31 09:49:28 Pi48 sshd[4883]: fatal: Cannot bind any address.

    Aug 31 09:49:28 Pi48 systemd[1]: ssh.service: Main process exited, code=exited, status=255/EXCEPTION

    Aug 31 09:49:28 Pi48 systemd[1]: ssh.service: Failed with result 'exit-code'.

    Aug 31 09:49:28 Pi48 systemd[1]: Failed to start OpenBSD Secure Shell server.

  • I had backports enabled from the OMV settings. Disabled it now (not using any backported packages as far as I can tell).
    Now ssh -v returns version: OpenSSH_6.7p2p1, OpenSSL 1.0.1t 3 May 2016


    As it is now the OMV gui shows ssh service disabled but I can login via ssh just fine.

    And when I try to enable the ssh service via the OMV gui I get the error shown in my initial post above.

  • My ssh does not have a -v option :/


  • yep right. :-/

    Here is my version. Seems to be the same.


    idimou@Pi48:~ $ dpkg -l | grep ssh

    ii libpam-chksshpwd:armhf 1.3.1-5+rpt2 armhf PAM module to enable SSH password checking support

    ii libssh2-1:armhf 1.8.0-2.1 armhf SSH2 client-side library

    ii openssh-client 1:7.9p1-10+deb10u2 armhf secure shell (SSH) client, for secure access to remote machines

    ii openssh-server 1:7.9p1-10+deb10u2 armhf secure shell (SSH) server, for secure access from remote machines

    ii openssh-sftp-server 1:7.9p1-10+deb10u2 armhf secure shell (SSH) sftp server module, for SFTP access from remote machines

    ii ssh 1:7.9p1-10+deb10u2 all secure shell client and server (metapackage)

    ii ssh-import-id 5.7-1 all securely retrieve an SSH public key and install it locally

    ii sshpass 1.06-1 armhf Non-interactive ssh password authentication

Participate now!

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