N
N
Nikolay2014-07-30 10:58:12
SSH
Nikolay, 2014-07-30 10:58:12

Why doesn't ssh allow from external ip?

On internal IP lets without problems.
Logs are empty for some reason (look at cat /var/log/messages | grep sshd )

ssh -vvv -p 2222 [email protected]:
OpenSSH_6.0p1 Debian-4+deb7u1, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to somesite.com [somesite.com] port 2222.
debug1: connect to address somesite.com port 26: Connection refused
ssh: connect to host somesite.com port 2222: Connection refused
grep -v # /etc/ssh/sshd_config:

Port 2222
ListenAddress 0.0.0.0
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin no
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Igor, 2014-07-30
@merryjane

Show the output of the commands:

netstat -ntpua | grep 2222
iptables-save
cat /etc/hosts.allow
cat /etc/hosts.deny

S
Sergey Petrikov, 2014-07-30
@RicoX

Most likely the problem is either in the firewall or in the routing, is your server by chance not behind nat?

A
Alexander, 2014-08-05
@QcfgAlexandr

As I understand it, you are a server behind NAT, forward port 22 (or which one you use for ssh) to the local address of the machine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question