Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: SSH doesn't run properly after boot

  1. #11
    Join Date
    Sep 2006
    Beans
    7,625
    Distro
    Lubuntu Development Release

    Re: SSH doesn't run properly after boot

    What do you get when you manually check the server's configuration?

    Code:
    /usr/sbin/sshd -T
    It should produce a list rather than an error message. If there is an error message, what is it?

  2. #12
    Join Date
    Apr 2006
    Beans
    Hidden!

    Re: SSH doesn't run properly after boot

    Quote Originally Posted by Lars Noodén View Post
    What do you get when you manually check the server's configuration?

    Code:
    /usr/sbin/sshd -T
    It should produce a list rather than an error message. If there is an error message, what is it?
    root@hamster:~# /usr/sbin/sshd -T
    port 22
    protocol 2
    addressfamily any
    listenaddress 0.0.0.0:22
    listenaddress [::]:22
    usepam 1
    serverkeybits 768
    logingracetime 120
    keyregenerationinterval 3600
    x11displayoffset 10
    maxauthtries 6
    maxsessions 10
    clientaliveinterval 0
    clientalivecountmax 3
    permitrootlogin yes
    ignorerhosts yes
    ignoreuserknownhosts no
    rhostsrsaauthentication no
    hostbasedauthentication no
    hostbasedusesnamefrompacketonly no
    rsaauthentication yes
    pubkeyauthentication yes
    kerberosauthentication no
    kerberosorlocalpasswd yes
    kerberosticketcleanup yes
    gssapiauthentication no
    gssapikeyexchange no
    gssapicleanupcredentials yes
    gssapistrictacceptorcheck yes
    gssapistorecredentialsonrekey no
    passwordauthentication yes
    kbdinteractiveauthentication no
    challengeresponseauthentication no
    printmotd no
    printlastlog yes
    x11forwarding yes
    x11uselocalhost yes
    strictmodes yes
    tcpkeepalive yes
    permitblacklistedkeys no
    permitemptypasswords no
    permituserenvironment no
    uselogin no
    compression delayed
    gatewayports no
    usedns yes
    allowtcpforwarding yes
    useprivilegeseparation yes
    pidfile /var/run/sshd.pid
    xauthlocation /usr/bin/xauth
    loglevel INFO
    syslogfacility AUTH
    authorizedkeysfile .ssh/authorized_keys .ssh/authorized_keys2
    hostkey /etc/ssh/ssh_host_rsa_key
    hostkey /etc/ssh/ssh_host_dsa_key
    hostkey /etc/ssh/ssh_host_ecdsa_key
    acceptenv LANG
    acceptenv LC_*
    subsystem sftp /usr/lib/openssh/sftp-server
    maxstartups 10:100:10
    permittunnel no
    ipqos lowdelay throughput
    permitopen any
    root@hamster:~#

  3. #13
    Join Date
    Sep 2006
    Beans
    7,625
    Distro
    Lubuntu Development Release

    Re: SSH doesn't run properly after boot

    That looks normal. But in post #10 above, you mentioned something that looks like an error. Is that the full error from "/usr/sbin/sshd -Dd" ?

  4. #14
    Join Date
    Apr 2006
    Beans
    Hidden!

    Re: SSH doesn't run properly after boot

    Quote Originally Posted by Lars Noodén View Post
    That looks normal. But in post #10 above, you mentioned something that looks like an error. Is that the full error from "/usr/sbin/sshd -Dd" ?
    No, that's from "service stop ssh".

  5. #15
    Join Date
    Apr 2006
    Beans
    Hidden!

    Re: SSH doesn't run properly after boot

    Quote Originally Posted by tofagerl View Post
    No, that's from "service stop ssh".

    I'd like to repeast that upon restarting SSHD, everything's fine. It's just after a reboot that it doesn't work.

  6. #16
    Join Date
    Sep 2006
    Beans
    7,625
    Distro
    Lubuntu Development Release

    Re: SSH doesn't run properly after boot

    Upstart does not seem to log much in the way of errors, though it should. That's the information that is missing. What does your upstart configuration file look like? It should be /etc/init/ssh.conf

  7. #17
    Join Date
    Apr 2006
    Beans
    Hidden!

    Re: SSH doesn't run properly after boot

    Quote Originally Posted by Lars Noodén View Post
    Upstart does not seem to log much in the way of errors, though it should. That's the information that is missing. What does your upstart configuration file look like? It should be /etc/init/ssh.conf
    # ssh - OpenBSD Secure Shell server
    #
    # The OpenSSH server provides secure shell access to the system.

    description "OpenSSH server"

    start on filesystem or runlevel [2345]
    stop on runlevel [!2345]

    respawn
    respawn limit 10 5
    umask 022

    # 'sshd -D' leaks stderr and confuses things in conjunction with 'console log'
    console none

    pre-start script
    test -x /usr/sbin/sshd || { stop; exit 0; }
    test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; }
    test -c /dev/null || { stop; exit 0; }

    mkdir -p -m0755 /var/run/sshd
    end script

    # if you used to set SSHD_OPTS in /etc/default/ssh, you can change the
    # 'exec' line here instead
    exec /usr/sbin/sshd -D

  8. #18
    Join Date
    Oct 2009
    Beans
    4
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: SSH doesn't run properly after boot

    Running Ubuntu Server 12.04.1 I also got this problem. Very frustrating.
    I tried manually creating /var/run/sshd and giving it 0755 permissions. Makes sshd start, but the folder is gone at next reboot and same error is showing.

  9. #19
    Join Date
    Apr 2006
    Beans
    Hidden!

    Re: SSH doesn't run properly after boot

    Interestingly, that does not work for me. The sshd-folder is not created in /var/run, but after creating it, chmoding, and rebooting, it still doesn't run.

    BUT it's still deleted!

    To me, this points to the init-script as the possible culprit, but surely this is the same for all users, so if that's the problem it has to be combined with another variable..

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

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