Can connect over SSH from Mac to linux

sshterminal

I have an Xubuntu server set up with SSH. I can connect to it using Putty on Windows and via a Chrome SSH plugin on my Mac. However, when I use terminal client it just hangs for a bit and then I get a connection reset. The debug output is:

ssh xxxxx@xx.xx.xx.xx:2222 -v

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 102: Applying options for *
debug1: Connecting to xx.xx.xx.xxx:2222 [xx.xx.xx.xx] port 22.
debug1: Connection established.
debug1: identity file /Users/xxxxx/.ssh/id_rsa type -1
debug1: identity file /Users/xxxxx/.ssh/id_rsa-cert type -1
debug1: identity file /Users/xxxxx/.ssh/id_dsa type -1
debug1: identity file /Users/xxxxx/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2

Does anyone have any advice?

Best Answer

I noticed in the debug output that there is mention of port '22' even though I specified '2222'. It like you need to put a '-p' flag in when using terminal:

ssh -p 2222 myname@xx.xx.xx.xx

This seems a bit weird as with other terminals I was using:

ssh myname@xx.xx.xx.xx:2222