в локалке работает, через интернет нет.
прописал правило в iptables:
sudo iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
вот что выводит sudo iptables -L -n
[console]
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:67
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:67
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:53
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 10.42.43.0/24 state RELATED,ESTABLISHED
ACCEPT all -- 10.42.43.0/24 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[/console]
почему то источник и назначение 0.0.0.0/0 - это нормально?
SSH Ubuntu 10.10 \ Linux Mint 10
Индустриальный Эльф, потому как у вас
ACCEPT all -- 0.0.0.0/0 10.42.43.0/24 state RELATED,ESTABLISHED Надо добавить OUTPUT:
iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 22 -j ACCEPTБез OUTPUT можно если бы у вас было примерно так:
Chain OUTPUT (policy DROP)
ACCEPT all -- anywhere anywhere state NEW,RELATED,ESTABLISHED Т.е. разрешить хосту открывать порты наружу:
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state NEW,ESTABLISHED,RELATED -j ACCEPTдолжно и так работать без дополнительных правил ведь политики на цепочки стоят "все разрешено"
не пойму...прописваю правила....проверяю...вижу что есть такие...
после ребута все что я писал пропало...
хоть прописывай хоть нет всё равно пустит
ну не пускает же
Индустриальный Эльф, весь скрипт в студию пожалуйста.
Индустриальный Эльф, весь скрипт в студию пожалуйста.
не понял... какой скрипт?
Показать
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.
# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
# 3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.
# Site-wide defaults for some commonly used options. For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.
Host *
# ForwardAgent no
# ForwardX11 yes
# ForwardX11Trusted yes
# RhostsRSAAuthentication no
# RSAAuthentication yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# GSSAPIKeyExchange no
# GSSAPITrustDNS no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
Port 22
# Protocol 2,1
# Cipher 3des
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
# VisualHostKey no
# ProxyCommand ssh -q -W %h:%p gateway.example.com
SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
[/console]
Индустриальный Эльф, iptables настраивали? Или ещё какой firewall?
iptables не настраивал...он почему то не сохраняет настройки..
фаервол - iptables...ещё имеется свистелка к iptables - firewall builder
только что заметил что из локалки я так же не могу присоединится...
раньше мог...
похоже я все поломал =(...
Индустриальный Эльф, ну удаляйте firewall builder, еще может в ubuntu стоит ufw - его тоже снести - никто же не знает что у вас там ещё, потом:
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPTЭто если firewall не нужен, если нужен то читайте тему например эту http://linuxforum.ru/viewtopic.php?id=13140 - только маскарадинг не включать, а так там готовый простой скрипт в конце.
ы. Хотя может у вас проблема в ssh (может с ключами что?) - листинг подключения приведите.
ssh: connect to host 10.42.43.1 port 22: Connection refused
[console]sudo !!
sudo netstat -nptul | grep 22
tcp 0 0 0.0.0.0:35224 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:9922 0.0.0.0:* LISTEN 1171/sshd
tcp6 0 0 :::9922 :::* LISTEN 1171/sshd
udp 0 0 0.0.0.0:5353 0.0.0.0:* 1225/avahi-daemon:
udp 0 0 0.0.0.0:42741 0.0.0.0:* 1225/avahi-daemon:
udp6 0 0 :::5353 :::* 1225/avahi-daemon:
udp6 0 0 :::55476 :::* 1225/avahi-daemon:
[/console]
почему то sshd привязался к 9922 пору...хотя в /etc/ssh/ssh_config я указал 22
теперь если явно указывать порт, то я как и раньше могу подключится по локалке\wifi, но через интеренет не пускает
вот какое дело нашел:
Если ты пишешь в /var/lib/iptables/rules-save
то не нужно делать /etc/init.d/iptables save
поскольку команда затирает твои изменения
сразу
#/etc/init.d/iptables stop
#/etc/init.d/iptables start
Заодно проверь /etc/conf.d/iptables, надо чтобы стояло
SAVE_ON_STOP="no"
иначе все равно сотрет твои изменения
прикольно то, что в бубунте нет ни var/lib/iptables/rules-save ни /etc/conf.d/iptables....
i hate ubuntu!!!