Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Ubuntu - Openssh

  • 22-04-2011 10: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,260 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,260 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,336 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