1

I'm trying to ssh to my Server. The SSH service is active when i check it with

sudo service ssh status

Also when i do netstat -nat | grep 22 i get

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 xx.xx.xx.xx:22       xx.xx.xx.xx:54197    ESTABLISHED
tcp6       0      0 :::22                   :::*                    LISTEN

I'm running following command on my Terminal:

ssh root@xx.xx.xx.xx

and i get following error

ssh: connect to host xx.xx.xx.xx port 22: Connection timed out

I also limited the access to my server via iptables. When i enter iptables -L i get following lines:

Chain INPUT (policy DROP)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  x.x.x.x              anywhere
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh

Chain FORWARD (policy DROP)
target     prot opt source               destination

Chain OUTPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  anywhere             x.x.x.x              
ACCEPT     all  --  anywhere             x.x.x.x              
ACCEPT     all  --  anywhere             x.x.x.x              
ACCEPT     all  --  anywhere             x.x.x.x              
ACCEPT     all  --  anywhere             x.x.x.x              
ACCEPT     all  --  anywhere             x.x.x.x              
ACCEPT     all  --  anywhere             x.x.x.x              
ACCEPT     all  --  anywhere             x.x.x.x              
ACCEPT     all  --  anywhere             x.x.x.x              
ACCEPT     all  --  anywhere             x.x.x.x              
ACCEPT     all  --  anywhere             x.x.x.x              
ACCEPT     all  --  anywhere             x.x.x.x              
ACCEPT     all  --  anywhere             x.x.x.x              
ACCEPT     all  --  anywhere             x.x.x.x              
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:ssh
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere             tcp spt:ssh
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED

I have absolutly no clue how i can fix this issue. Can anyone help me?

Kind regards, Kevin

1 Answers1

1

It may be the case that you do not have the "PermitRootLogin" setting in your SSH config file set to accept connections using the root account. In the config file (mine is /etc/ssh/sshd_config), this setting is "no" by default (for security reasons). Try connecting using another user account with SSH access, or try changing PermitRootLogin to "yes" and see what happens.

Darrell
  • 11