Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Problem connecting via ssh

  1. #1
    Join Date
    Apr 2013
    Beans
    33

    Problem connecting via ssh

    There are two hosts:
    Host a running ubuntu 16.4
    Host b running ubunto 18.4

    I can ssh from a to b without problems.

    However, when I try on b ssh user@a, I am asked for the password and provide it.
    Then the connection is immediately terminated.
    The password is correct: I tried to give a false one and get an appropriate error message.
    The correct one is accepted; then I am immediately back to the shell in b.

    Any ideas?

  2. #2
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Problem connecting via ssh

    What do you see in /var/log/auth.log and /var/log/syslog on the machine that is refusing connections? Remember, logs are your friends.

    On machine b, try using "ssh -vvv user@a" to increase the "verbosity" of the client. Often that will identify the problem right away.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Apr 2013
    Beans
    33

    Re: Problem connecting via ssh

    The two logfiles do not change when I attempt connection. The lalst entry is an hour old and due to some cron job.
    The output of ssh --v is very long. Various authentication methods are tried, finally authentication by password,
    which succeeds.(Otherwise I would see an error message, tried this with intentionally wrong password).

    I attach the debug output.

    MaybeI I should reinstall open ssh.
    I did not install myself, it came with a new notebook that is sold with preinstalled ubuntu 18.4
    Attached Files Attached Files

  4. #4
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,703

    Re: Problem connecting via ssh

    Maybe a dumb question but is user able to log on locally at machine a?

  5. #5
    Join Date
    Apr 2013
    Beans
    33

    Re: Problem connecting via ssh

    login <user> gives "login: Cannot possibly work without effective root",
    but
    ssh<user>@<myhost> works as expected.

  6. #6
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Problem connecting via ssh

    It's strange that you have no corresponding entry in /var/log/auth.log. I use keys rather than a password, and see entries this on the server end when I connect:
    Code:
    Jul 28 14:40:22 linux-tv sshd[23523]: Accepted publickey for xxx from 192.168.100.59 port 51000 ssh2: RSA SHA256:FXYyLbgoZMXylGlkbpODbZanuUyGOXwtO1GiTvqw1Jk
    If you use login at the console on machine a and run "ssh user@localhost" does that work?
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  7. #7
    Join Date
    Apr 2013
    Beans
    33

    Re: Problem connecting via ssh

    login <user> gives "login: Cannot possibly work without effective root",
    but
    ssh<user>@<myhost> works as expected.

  8. #8
    Join Date
    Apr 2013
    Beans
    33

    Re: Problem connecting via ssh

    Yes, ssh user@localhost does work and in that case the files auth.log, wtmp, lastlog, and syslog in /var/log are updated.
    Also, I am able to connect from host a to three other hosts, Raspberry PI's.
    And ssh from a PI into host a also works fine.
    So the problem lies in host b.
    Shall I reinstall Open SSH on host b?

  9. #9
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Problem connecting via ssh

    Can't hurt.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  10. #10
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,703

    Re: Problem connecting via ssh

    Try the ssh connection from B, then on B run the command "ip neighbor". Make sure the MAC address for A matches the MAC address that the command "ip addr" on A. I'm wondering of you have two machines with A's address.

Page 1 of 2 12 LastLast

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
  •