Here is my problem:
I want to log to my ubuntu server from a macbookpro (10.10.4) via ssh but it is not working from any public IP address
When I m on the same wifi than my server and that I try to connect to the private/local IP it is just working fine. It asks my password and I can login :
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: Connecting to XXX.XXX.X.XX [XXX.XXX.X.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 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.4 debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.4 pat OpenSSH* debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr email@example.com none debug1: kex: client->server aes128-ctr firstname.lastname@example.org none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: Server host key: RSA XX:XX:XX:XXX:XX:XX debug1: Host 'XXX.XXX.X.XX' is known and matches the RSA host key. debug1: Found key in /Users/XXXXX/.ssh/known_hosts:1 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Trying private key: /Users/XXXXX/.ssh/id_rsa debug1: Trying private key: /Users/XXXXX/.ssh/id_dsa debug1: Next authentication method: password XXXXX@XXX.XXX.X.XX's password:
But when I'm trying to connect from public IP I get this message:
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: Connecting to XX.XX.XXX.XX [XX.XX.XXX.XX] port 22. debug1: connect to address XX.XX.XX.XX port 22: Connection refused ssh: connect to host XX.XX.XX.XX port 22: Connection refused
Here is what I've done until now:
Checked which port is listening ssh -> port 22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 5886/sshd
Checked if the firewall was active on the port 22 -> it is not
sudo ufw verbose Status: inactive
Tried to uninstall/reinstall openssh-server with apt-get -> didn't change a thing
Screamed and punched the wall -> didn't change a thing
What can I do to fix this issue?
Is there a particular problem with connecting from a mac ?
I'm quite new to Linux so be gentle, please :)