[SOLVED] SSH not starting
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2013
    Location
    Australia
    Posts
    77

    SSH not starting

    Just did a clean install of Fedora 28. 64 bit.
    Followed as I have done in the past to get SSH working.
    1. Checked to see if openssh-server was installed.
    then did systemctl start sshd.service and got the following error messages.

    # systemctl start sshd.service
    Job for sshd.service failed because the control process exited with error code.
    See "systemctl status sshd.service" and "journalctl -xe" for details.

    # systemctl status sshd.service
    ● sshd.service - OpenSSH server daemon
    Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: disabled)
    Active: activating (auto-restart) (Result: exit-code) since Tue 2018-06-12 15:00:30 AEST; 33s ago
    Docs: man:sshd(8)
    man:sshd_config(5)
    Process: 28150 ExecStart=/usr/sbin/sshd -D $OPTIONS $CRYPTO_POLICY (code=exited, status=255)
    Main PID: 28150 (code=exited, status=255)

    # journalctl -xe
    -- Defined-By: systemd
    -- Support: https://lists.freedesktop.org/mailma.../systemd-devel
    --
    -- Unit sshd.service has begun starting up.
    Jun 12 15:15:59 localhost.localdomain audit[29886]: AVC avc: denied { name_bind } for pid=29886 comm="sshd" >
    Jun 12 15:15:59 localhost.localdomain sshd[29886]: error: Bind to port 2023 on 0.0.0.0 failed: Permission denie>
    Jun 12 15:15:59 localhost.localdomain sshd[29886]: error: Bind to port 2023 on :: failed: Permission denied.
    Jun 12 15:15:59 localhost.localdomain sshd[29886]: fatal: Cannot bind any address.
    Jun 12 15:15:59 localhost.localdomain audit[29886]: AVC avc: denied { name_bind } for pid=29886 comm="sshd" >
    Jun 12 15:15:59 localhost.localdomain audit[29886]: CRYPTO_KEY_USER pid=29886 uid=0 auid=4294967295 ses=4294967>
    Jun 12 15:15:59 localhost.localdomain audit[29886]: CRYPTO_KEY_USER pid=29886 uid=0 auid=4294967295 ses=4294967>
    Jun 12 15:15:59 localhost.localdomain audit[29886]: CRYPTO_KEY_USER pid=29886 uid=0 auid=4294967295 ses=4294967>
    Jun 12 15:15:59 localhost.localdomain systemd[1]: sshd.service: Main process exited, code=exited, status=255/n/a
    Jun 12 15:15:59 localhost.localdomain systemd[1]: sshd.service: Failed with result 'exit-code'.
    Jun 12 15:15:59 localhost.localdomain systemd[1]: Failed to start OpenSSH server daemon.
    -- Subject: Unit sshd.service has failed
    -- Defined-By: systemd
    -- Support: https://lists.freedesktop.org/mailma.../systemd-devel
    --
    -- Unit sshd.service has failed.
    --
    -- The result is RESULT.
    Jun 12 15:15:59 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=s>
    lines 2823-2845/2845 (END)
    --
    -- The result is RESULT.
    Jun 12 15:15:59 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=s>

    Can ansy one advise on how to fix Thanks

  2. #2
    Join Date
    Oct 2011
    Posts
    1,824

    Re: SSH not starting

    Try:

    Code:
    # touch /.autorelabel
    $ reboot

  3. #3
    Join Date
    Dec 2017
    Location
    USA
    Posts
    46

    Re: SSH not starting

    What srakitnician is suggesting is to reboot with a pfile present on the / filesystem. Upon boot, the system will run a "restorecon" to restore the selinux file contexts of all the files on that filesystem, to the default values. The fact that there are AVC denied messages in your sshd status output is the indicator that it's selinux preventing it from working.

  4. #4
    Join Date
    Dec 2012
    Location
    santa barbara, CA
    Posts
    909

    Re: SSH not starting

    my $0.02

    in all my comps I disable selinux, and I have found out, that for example in my servers, where I also disable NetworkManager, cuz I need to, cuz I want to move IPs around at runtime without rebooting etc,

    a LOT of things do not start when the machine boots. And it all comes down to TIMING.

    Linux used to enable network by default, and right after the boot, before any other stuff. Now that good ol' thing has gone the way of the pink elephants floating in a sea of lunacy, so, therefore:

    I have found that for example, creating the /etc/rc.d/rc.local
    and in there doing:
    Code:
    [root@shark3 ~]# cat /etc/rc.d/rc.local
    #!/bin/bash
    
    echo "entering rc.local"
    sleep 20
    systemctl restart sshd
    sleep 2
    systemctl restart firewalld
    .
    .
    .
    makes my stuff work.
    That 20 seconds is how much "systemd" needs to "find itself", so that we can get down to business.
    "monsters John ... monsters from the ID..."
    "ma vule teva maar gul nol naya"

  5. #5
    Join Date
    Mar 2013
    Location
    Australia
    Posts
    77

    Re: SSH not starting

    Thanks. Problem solved.
    Part of it was my faulty internal documentation that I keep on each machine and I found that bobx101's suggestion mde it work relaibly.

    thanks again (not sure how to mark this as solved)

Similar Threads

  1. Kde not starting
    By airchair in forum Using Fedora
    Replies: 16
    Last Post: 21st June 2014, 10:08 AM
  2. Starting off?
    By Phail in forum Using Fedora
    Replies: 9
    Last Post: 16th July 2011, 06:54 AM
  3. Long delays starting up, and starting most programs.
    By LionKimbro in forum Using Fedora
    Replies: 0
    Last Post: 4th May 2006, 03:21 PM
  4. Replies: 6
    Last Post: 11th October 2005, 01:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •