Connection closed, no reason given - SSH

This is a discussion on Connection closed, no reason given - SSH ; Hi, I was trying to set up passwordless authentication via ssh from one machine to another. I generated the key pair on my local machine using ssh-keygen -t dsa I copied the entry from id_dsa.pub into the remote machine's ..ssh/authorized_keys ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Connection closed, no reason given

  1. Connection closed, no reason given

    Hi,

    I was trying to set up passwordless authentication via ssh from one
    machine to another. I generated the key pair on my local machine using


    ssh-keygen -t dsa

    I copied the entry from id_dsa.pub into the remote machine's
    ..ssh/authorized_keys file and expected to be able to login without a
    problem. However, when I try and login now it simply says

    Connection closed by 192.168.1.108

    And I can't ssh into it anymore. I suspect the problem is in the
    authorized_keys file, how can I force it to not look in there without
    having to go to that machine and manually delete the entry?


  2. Re: Connection closed, no reason given

    On 2005-11-04, jois.de.vivre@gmail.com wrote:
    [...]
    > I copied the entry from id_dsa.pub into the remote machine's
    > .ssh/authorized_keys file and expected to be able to login without a
    > problem. However, when I try and login now it simply says
    >
    > Connection closed by 192.168.1.108
    >
    > And I can't ssh into it anymore. I suspect the problem is in the
    > authorized_keys file, how can I force it to not look in there without
    > having to go to that machine and manually delete the entry?


    You're using OpenSSH? (looks like it but you don't say)

    I suspect you corrupted the key while copying it into authorized_keys.
    Depending on exactly how it was corrupted, earlier versions of OpenSSH
    didn't handle that well and would abort the connection. This has been
    fixed for a while.

    You can prevent you client from trying public-key authentication
    which will probably let you log in ok. For OpenSSH, this is
    "ssh -oPreferredAuthentications=password yourserver" (or possibly
    keyboard-interactive instead of password). For other clients it will
    probably be different.

    --
    Darren Tucker (dtucker at zip.com.au)
    GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
    usually comes from bad judgement.

  3. Re: Connection closed, no reason given

    jois.de.vivre@gmail.com writes:

    >Hi,


    >I was trying to set up passwordless authentication via ssh from one
    >machine to another. I generated the key pair on my local machine using



    >ssh-keygen -t dsa


    >I copied the entry from id_dsa.pub into the remote machine's
    >.ssh/authorized_keys file and expected to be able to login without a
    >problem. However, when I try and login now it simply says


    >Connection closed by 192.168.1.108


    >And I can't ssh into it anymore. I suspect the problem is in the
    >authorized_keys file, how can I force it to not look in there without
    >having to go to that machine and manually delete the entry?



    So you have root access on the remote machine? Did you do this for all
    accounts on the remote machine? Ie, log in as another user and then su to
    root to fix stuff.

    Anyway, what often happens is that line breaks are introduced by the editor
    on placing the string into the authorized_keys file.

    The other think is if you experimenting, leave one connection always open
    so that you can recover. Otherwise you are in the hole you are in now--
    unable to get in to fix anything. So go over to that machine, delete the
    entry and then do things with a fallback position.


+ Reply to Thread