Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, I'm NO Linux expert, but we have some Linux servers at work. Now there is a problem with 1 of them. SSH only works when entering this command: exec ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2012
    Posts
    3

    ssh problem


    Hi,

    I'm NO Linux expert, but we have some Linux servers at work. Now there is a problem with 1 of them. SSH only works when entering this command:

    exec /usr/sbin/sshd -d

    you get 1 session and that's it.

    I checked and ssh is running (before executing the exec command). The message states connection refused.

    As adviced I allready cleared the known_hosts file, but this didn't work. I don't think it's an issue with port 22, as I CAN connect given the above command.

    Any ideas?

    thanks

    Davy

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,392
    hi and welcome

    -d is the debug mode. sshd will not become a daemon and only serve one connection, as you experience.
    Manual Pages: sshd(

    Dont use that exec line, instead start sshd via its init script.
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Nov 2012
    Posts
    3
    well, that's the problem. it only works in debug mode...

  4. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,392
    Ok, so what was changed on that server or for sshd?
    What happens, if you start sshd via init?
    Code:
    /etc/init.d/ssh restart
    You can test the configfile with
    Code:
    sshd -t
    or
    Code:
    sshd -T
    and look for errors in /var/log/auth.log (debian default)

    Note:
    sshd -T will write the configfile to stdout if no syntax error is found.
    You must always face the curtain with a bow.

  5. #5
    Just Joined!
    Join Date
    Nov 2012
    Posts
    3
    thanks mate, it works.

    error message: fatal: daemon() failed: No such device

    I did this:

    remove /dev/null
    and then: "mknod /dev/null c 1 3"

    and it works!

Posting Permissions

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