Unable to Login via SSH: sshd.service Failed to Start (Failed at step EXEC spawning /usr/local/sbin/sshd: No such file or directory)

Solution Verified - Updated -

Issue

  • Server cannot be accessed via SSH and only accessible through virtual machine's console.

  • Connection to the server refuses with Connection refused error.

    ssh: connect to host xx.x.xx.xxx port 22: Connection refused
    
  • sshd service failed to start with following errors.

    systemd[x]: sshd.service: Failed to execute command: No such file or directory
    systemd[x]: sshd.service: Failed at step EXEC spawning /usr/local/sbin/sshd: No such file or directory
    systemd[x]: sshd.service: Main process exited, code=exited, status=203/EXEC
    systemd[x]: sshd.service: Failed with result 'exit-code'.
    systemd[x]: Failed to start OpenSSH server daemon.
    

Environment

  • Red Hat Enterprise Linux (All versions)
  • openssh

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content