-2

i have a fresh instalation of centos 6.6. on a HP Proliant DL360. i have installed mysql, php, apache

i unable to login through putty from my ip x.x.x.x but when using within my lan 192.168.0.5 i can connect fine

Q. Why am i unable to connect to ssh login via my ip outside of lan?

The current tcp netstat on port 22 reading is:

[root@localhost etc]#  netstat -tulpn | grep :22
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      7646/sshd
tcp        0      0 :::22                       :::*                        LISTEN      7646/sshd

The iptables currently set as the following:

[root@localhost etc]# iptables --line -vnL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1    20825   14M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
2        0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0
3       45  2700 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
4        3   156 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
5        0     0 ACCEPT     tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0           tcp spt:80 state NEW,ESTABLISHED
6     1302 67684 ACCEPT     tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0           tcp dpt:80 state NEW,ESTABLISHED
7     2151  276K REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

The server ip settings:

[root@localhost etc]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:1e:0b:5e:59:22 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.5/24 brd 192.168.0.255 scope global eth0
    inet6 fe80::21e:bff:fe5e:5922/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 00:1e:0b:5e:59:1a brd ff:ff:ff:ff:ff:ff
  • 2
    Please edit your question and provide details on your network. It's highly likely that there's a firewall or NAT at the border of your LAN that is blocking access from outside. – EEAA Aug 3 '15 at 3:05
  • this solved the question. Thankyou. – Derple Aug 3 '15 at 3:24
3

You've only got a private IP address associated with the machine, so you'll need to configure whatever has the public IP address you want to connect to to pass the SSH connections onto this server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.