Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Ubuntu - Openssh

  • 22-04-2011 11:48AM
    #1
    Registered Users, Registered Users 2 Posts: 297 ✭✭


    Hi there,

    I have two Ubuntu PC's connected over a LAN connection.

    I've installed openssh server on both.

    I can ssh into PC B from PC A but can't ssh from PC A in PC B.

    It keeps exiting.

    I don't have a firewall running on either PC

    Any ideas? I've googled it and tried everything suggested to no avail.

    Regards,
    Mark,


Comments

  • Registered Users, Registered Users 2 Posts: 297 ✭✭markyboy


    Thanks OSI

    I appreciate your help. To answer yourquestions
    OSI wrote: »
    Are you using the same user to SSH from A to B as you would normally login to B with?

    I login to both machines with the same username and password
    OSI wrote: »
    Do you have a terminal set for the user on PC B?

    I created a separate account and switched to that user on PC B and it still timed out


  • Registered Users, Registered Users 2 Posts: 297 ✭✭markyboy


    OSI wrote: »
    What's the exact error message it gives? Or does it give a message at all?

    ssh: connect to host 192.168.1.2 port 22: Connection timed out


    I know already this is going to be something really easy or tortuously difficult :)


  • Registered Users, Registered Users 2 Posts: 297 ✭✭markyboy


    OSI wrote: »
    Hmmm, either OpenSSH isn't actually running or something is blocking access to the port.

    On PC B what does

    ps auxw | grep sshd | grep -v grep

    Show?

    If it doesn't show anything, try

    sudo service ssh start

    mark@home-desktop:/home/home$ ps auxw | grep sshd | grep -v grep
    root 788 0.0 0.0 5552 2140 ? Ss 12:05 0:00 /usr/sbin/sshd -D
    root 2181 0.0 0.1 8864 3056 ? Ss 12:48 0:00 sshd: home [priv]
    home 2258 0.0 0.0 8864 1596 ? S 12:48 0:00 sshd: home@notty

    sorry about the formatting


  • Registered Users, Registered Users 2 Posts: 297 ✭✭markyboy


    OSI wrote: »
    OK, so sshd is running, and the user should have a shell as you can login.

    Only thing I can think of is routing or some sort of port filtering.

    One more:

    sudo nmap -sS -O 192.168.1.2

    Not shown: 995 closed ports
    PORT STATE SERVICE
    21/tcp open ftp
    23/tcp open telnet
    53/tcp open domain
    80/tcp open http
    139/tcp open netbios-ssn

    So port 22 isn't open?

    I've switched modem's recently and now have to work out how to open ports on a Vodafone HG556a


  • Moderators, Education Moderators, Home & Garden Moderators Posts: 8,314 Mod ✭✭✭✭Jonathan


    Run ssh with -vvv to show verbose output.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 297 ✭✭markyboy


    Jonathan wrote: »
    Run ssh with -vvv to show verbose output.

    here we go

    debug3: packet_send2: adding 64 (len 53 padlen 11 extra_pad 64)
    debug2: we sent a password packet, wait for reply
    debug3: Wrote 144 bytes for a total of 1271
    debug1: Authentication succeeded (password).
    debug1: channel 0: new [client-session]
    debug3: ssh_session2_open: channel_new: 0
    debug2: channel 0: send open
    debug1: Requesting no-more-sessions@openssh.com
    debug1: Entering interactive session.
    debug3: Wrote 128 bytes for a total of 1399
    debug2: callback start
    debug2: client_session2_setup: id 0
    debug2: channel 0: request pty-req confirm 1
    debug1: Sending environment.
    debug3: Ignored env ORBIT_SOCKETDIR
    debug3: Ignored env GPG_AGENT_INFO
    debug3: Ignored env TERM
    debug3: Ignored env SHELL
    debug3: Ignored env XDG_SESSION_COOKIE
    debug3: Ignored env WINDOWID
    debug3: Ignored env GNOME_KEYRING_CONTROL
    debug3: Ignored env GTK_MODULES
    debug3: Ignored env USER
    debug3: Ignored env LS_COLORS
    debug3: Ignored env SSH_AUTH_SOCK
    debug3: Ignored env DEFAULTS_PATH
    debug3: Ignored env SESSION_MANAGER
    debug3: Ignored env USERNAME
    debug3: Ignored env XDG_CONFIG_DIRS
    debug3: Ignored env DESKTOP_SESSION
    debug3: Ignored env PATH
    debug3: Ignored env PWD
    debug3: Ignored env GDM_KEYBOARD_LAYOUT
    debug1: Sending env LANG = en_IE.UTF-8
    debug2: channel 0: request env confirm 0
    debug3: Ignored env MANDATORY_PATH
    debug3: Ignored env GDM_LANG
    debug3: Ignored env GDMSESSION
    debug3: Ignored env HISTCONTROL
    debug3: Ignored env SPEECHD_PORT
    debug3: Ignored env SHLVL
    debug3: Ignored env HOME
    debug3: Ignored env GNOME_DESKTOP_SESSION_ID
    debug3: Ignored env LOGNAME
    debug3: Ignored env XDG_DATA_DIRS
    debug3: Ignored env DBUS_SESSION_BUS_ADDRESS
    debug3: Ignored env LESSOPEN
    debug3: Ignored env DISPLAY
    debug3: Ignored env LESSCLOSE
    debug3: Ignored env XAUTHORITY
    debug3: Ignored env COLORTERM
    debug3: Ignored env _
    debug2: channel 0: request shell confirm 1
    debug2: fd 3 setting TCP_NODELAY
    debug2: callback done
    debug2: channel 0: open confirm rwindow 0 rmax 32768
    debug3: Wrote 448 bytes for a total of 1847
    debug2: channel_input_status_confirm: type 99 id 0
    debug2: PTY allocation request accepted on channel 0
    debug2: channel 0: rcvd adjust 2097152
    debug2: channel_input_status_confirm: type 99 id 0
    debug2: shell request accepted on channel 0
    Linux home-desktop 2.6.32-30-generic #59-Ubuntu SMP Tue Mar 1 21:30:21 UTC 2011 i686 GNU/Linux
    Ubuntu 10.04.2 LTS

    Welcome to Ubuntu!
    * Documentation: https://help.ubuntu.com/

    Last login: Fri Apr 22 11:02:51 2011 from localhost


  • Moderators, Education Moderators, Home & Garden Moderators Posts: 8,314 Mod ✭✭✭✭Jonathan


    I thought you said you couldn't log in? :confused:


  • Registered Users, Registered Users 2 Posts: 297 ✭✭markyboy


    Apologies. Ran it on the wrong machine.

    This is thresult of trying to connect from PC B to PC A

    home@home-desktop:~$ ssh -vvv user@192.168.1.1
    OpenSSH_5.3p1 Debian-3ubuntu6, OpenSSL 0.9.8k 25 Mar 2009
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to 192.168.1.1 [192.168.1.1] port 22.
    debug1: connect to address 192.168.1.1 port 22: Connection refused
    ssh: connect to host 192.168.1.1 port 22: Connection refused


  • Registered Users, Registered Users 2 Posts: 297 ✭✭markyboy


    Re-booted both PC's and un-installed and re-installed everything. It's working now.

    Thank you both for your help, time and patience. I really appreciate it.

    Mark.


  • Moderators, Technology & Internet Moderators Posts: 1,338 Mod ✭✭✭✭croo


    I don't setup systems so often, but I think I usually need to add a new system's address to the /etc/hosts.allow on a new installation so I can ssh into it from my other boxes.

    I think it is also recommended to set /etc/hosts.deny to ALL:ALL


  • Advertisement
Advertisement