Доступ к моему веб-серверу публично

На моем сервере Debian у меня есть интерфейс eth0 (192.168.10.x), и я только что добавил eth1 (176.31.36.x). Я хотел бы настроить публичный доступ для ssh, web и т. Д.

allow-hotplug eth1
iface eth1 inet static
        address 176.31.36.x
        netmask 255.255.255.240
        network 176.31.36.x
        broadcast 171.31.36.x
        dns-nameservers 8.8.8.8
        gateway 176.31.36.x
        dns-search mydomain.com

Я добавил эти маршруты:

iptables -I INPUT -p tcp --dport 80 -j ACCEPT -m comment --comment "Allow HTTP"
iptables -I INPUT -p tcp --dport 443 -j ACCEPT -m comment --comment "Allow HTTPS"
iptables -I INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT -m comment --comment "Allow SSH"

После этого сервер был перезагружен. Проверка связи с машиной работает, но ни ssh, ни веб не отвечают.

Пример:

ssh -v 176.31.36.x
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 176.31.36.x [176.31.36.x] port 22.
debug1: Connection established.
debug1: identity file /home/admin/.ssh/id_rsa type -1
debug1: identity file /home/admin/.ssh/id_rsa-cert type -1
debug1: identity file /home/admin/.ssh/id_dsa type -1
debug1: identity file /home/admin/.ssh/id_dsa-cert type -1
debug1: identity file /home/admin/.ssh/id_ecdsa type -1
debug1: identity file /home/admin/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/admin/.ssh/id_ed25519 type -1
debug1: identity file /home/admin/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-3ubuntu1
debug1: match: OpenSSH_6.0p1 Debian-3ubuntu1 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 10:59:34:f5:bb:bb:6b:3f:7a:39:1b:26:24:45:18:cb
debug1: Host '176.31.36.x' is known and matches the ECDSA host key.
debug1: Found key in /home/admin/.ssh/known_hosts:57
debug1: ssh_ecdsa_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
debug1: Next authentication method: publickey
debug1: Trying private key: /home/admin/.ssh/id_rsa
debug1: Trying private key: /home/admin/.ssh/id_dsa
debug1: Trying private key: /home/admin/.ssh/id_ecdsa
debug1: Trying private key: /home/admin/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).

Обновление: Выход из netstat:

sudo netstat -lpn | grep ^tcp
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      508/beam        
tcp        0      0 127.0.0.1:44400         0.0.0.0:*               LISTEN      508/beam        
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      10968/sshd      
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      846/exim4       
tcp        0      0 0.0.0.0:8443            0.0.0.0:*               LISTEN      508/beam        
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN      443/memcached   
tcp6       0      0 :::80                   :::*                    LISTEN      906/apache2     
tcp6       0      0 ::1:25                  :::*                    LISTEN      846/exim4       
tcp6       0      0 :::443                  :::*                    LISTEN      906/apache2    
0
23.09.2015, 16:53
0 ответов

Теги

Похожие вопросы