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

Thread: Not getting an ssh login on one computer

  1. #1
    Join Date
    Mar 2007
    Beans
    1,325

    Not getting an ssh login on one computer

    I have a couple of Ubuntu 18.04 computers at home. Since using them more for work recently I decided to set up ssh on the so I could do remover administration.
    I installed openssh-server on both one works fine, the other initially worked but now doesn't prompt for a password when I try to access it and eventually times out. I can't find anything in the logs to give me a clue as to why.
    I've never had this problem before openssh-server has simply just worked.
    I've compared the configuration files and as afar as I can tell they are the defaults loaded when I installed the server.
    The one significant difference between the tow is that one is on the WiFi network and the other is one a wired network.

    OK I found this in syslog:
    Code:
    syslog:May 17 15:49:55 apartment systemd[1290]: Closed GnuPG cryptographic agent (ssh-agent emulation).
    syslog:May 17 15:49:55 <machinename> systemd[1464]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
    syslog:May 17 15:49:57 <machinename> gnome-keyring-ssh.desktop[1547]: SSH_AUTH_SOCK=/run/user/1001/keyring/ssh
    user 1001 is a different user than the user I'm attempting to login in as

    A successful login to the other machine only lists the following:

    Code:
    May 17 11:09:53 <machinename> systemd[1514]: Closed GnuPG cryptographic agent (ssh-agent emulation).
    May 17 11:09:54 <machinename>  systemd[1708]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
    Last edited by rsteinmetz70112; May 17th, 2020 at 10:09 PM.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Not getting an ssh login on one computer

    All systems have static ips?

    Setting up ssh w/ keys is pretty easy. Think 3 commands. I’ve posted them here a few times. Look for ssh-keygen, ssh-copy-id and some ~/.ssh/config setup. https://ubuntuforums.org/showthread....6#post13916386
    Last edited by TheFu; May 18th, 2020 at 02:51 PM.

  3. #3
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,790

    Re: Not getting an ssh login on one computer

    You can debug ssh with:
    $ ssh -vvv user@server

  4. #4
    Join Date
    Mar 2007
    Beans
    1,325

    Re: Not getting an ssh login on one computer

    Quote Originally Posted by HermanAB View Post
    You can debug ssh with:
    $ ssh -vvv user@server
    Code:
    $ ssh -vvv me@machinename
    OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 19: Applying options for *
    debug2: resolving "machinename" port 22
    debug2: ssh_connect_direct: needpriv 0
    debug1: Connecting to machinename [192.168.2.51] port 22.
    ssh: connect to host apartment port 22: Connection timed out
    That doesn't seem to tell me anything I didn't already know - the connection to the remote machine nae is timing out.

  5. #5
    Join Date
    Mar 2007
    Beans
    1,325

    Re: Not getting an ssh login on one computer

    Quote Originally Posted by TheFu View Post
    All systems have static ips?
    The remote machine is DHCP, but it never changes.

    Setting up ssh w/ keys is pretty easy. Think 3 commands. I’ve posted them here a few times. Look for ssh-keygen, ssh-copy-id and some ~/.ssh/config setup. https://ubuntuforums.org/showthread....6#post13916386
    I'm not sure the problem is with ssh.

  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Not getting an ssh login on one computer

    Quote Originally Posted by rsteinmetz70112 View Post
    Code:
    $ ssh -vvv me@machinename
    OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 19: Applying options for *
    debug2: resolving "machinename" port 22
    debug2: ssh_connect_direct: needpriv 0
    debug1: Connecting to machinename [192.168.2.51] port 22.
    ssh: connect to host apartment port 22: Connection timed out
    That doesn't seem to tell me anything I didn't already know - the connection to the remote machine nae is timing out.
    It tells me that there isn't an sshd listing on the IP address that the client is pointing at. Hence, the question about static IPs.

    Can you $ ping machinename?
    Is sshd running on the other machine?
    Is there a firewall blocking inbound connections on the other machine?
    Those are pretty much the problems for this symptom.

  7. #7
    Join Date
    Mar 2007
    Beans
    1,325

    Re: Not getting an ssh login on one computer

    Quote Originally Posted by TheFu View Post
    It tells me that there isn't an sshd listing on the IP address that the client is pointing at. Hence, the question about static IPs.

    Can you $ ping machinename?
    Yes by name or IP address
    Is sshd running on the other machine?
    Yes
    Is there a firewall blocking inbound connections on the other machine?
    No
    Those are pretty much the problems for this symptom.
    Which is why I can't figure out why it's not working.

  8. #8
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Not getting an ssh login on one computer

    Good info. Something should show up in the logs and with -vvvv. Time to break out the packet sniffer on the client. Perhaps ipv6 has taken over 1 machine? Had to add a new setting to an sshd_config to disable ipv6 on a few of my boxes last year. But connection attempts were showing up in my logs. The setting ....
    Code:
    AddressFamily inet
    I’m assuming all the rest of the settings are default.

  9. #9
    Join Date
    Mar 2007
    Beans
    1,325

    Re: Not getting an ssh login on one computer

    Quote Originally Posted by TheFu View Post
    Good info. Something should show up in the logs and with -vvvv. Time to break out the packet sniffer on the client. Perhaps ipv6 has taken over 1 machine? Had to add a new setting to an sshd_config to disable ipv6 on a few of my boxes last year. But connection attempts were showing up in my logs. The setting ....
    Code:
    AddressFamily inet
    I’m assuming all the rest of the settings are default.
    All settings are the defaults. In fact I've never needed anything else in the past to get it to work on Ubuntu.
    I guess I'll go back through the logs and see if I can find anything.
    Unfortunately I think the -vvv will only affect the initiating machine(client) and nothing much seems to be happening of the receiving machine(server).
    I think as you said above the ssh command is not making contact with sshd on the server.
    ifconfig reports the correct ipv4 address so I don't think ipv6 has taken over although is also has ipv6 addresses.
    Last edited by rsteinmetz70112; May 19th, 2020 at 04:05 AM.

  10. #10
    Join Date
    Jul 2009
    Beans
    516
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Not getting an ssh login on one computer

    If you've still got an issue you could try running _sshd_ in debug mode on the server
    Code:
    sudo /usr/sbin/sshd -ddd -p 2022
    which will make it listen on port 2022 and make it show any connection attempts.
    Then from your client try with
    Code:
    ssh -p 2022 -vvv me@machinename
    If that doesn't work then it may be your home router/wifi. I think with some you can restrict inbound connections to wifi connected devices.

    It's pretty easy to test network connectivity between systems using netcat / socat
    server:
    Code:
    nc -l -p 2022
    client:
    Code:
    nc remotehost 2022
    You can then send messages between the two systems by typing and pressing enter.

    If that works, the network / wifi is fine and it's something going on on that host with ssh / port 22.

    You can check for firewall rules using
    Code:
    sudo iptables-save
    Mark your thread as [SOLVED], use Thread Tools on forum page.

Page 1 of 2 12 LastLast

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
  •