Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2013 11:00:24 +0100
From:      Fleuriot Damien <ml@my.gd>
To:        mexas@bristol.ac.uk
Cc:        freebsd-questions@freebsd.org
Subject:   Re: cannot ssh into a box with DHCP assigned IP address
Message-ID:  <9A8F9CCD-C90B-4033-992F-0458D6128005@my.gd>
In-Reply-To: <201302200945.r1K9jpq7029535@mech-cluster241.men.bris.ac.uk>
References:  <201302200945.r1K9jpq7029535@mech-cluster241.men.bris.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help

On Feb 20, 2013, at 10:45 AM, Anton Shterenlikht <mexas@bristol.ac.uk> =
wrote:

> 	From: Fleuriot Damien <ml@my.gd>
> 	To: mexas@bristol.ac.uk
> 	Subject: Re: cannot ssh into a box with DHCP assigned IP address
> 	Date: Wed, 20 Feb 2013 10:31:22 +0100
> 	Cc: freebsd-questions@freebsd.org
>=20
> 	On Feb 20, 2013, at 10:28 AM, Anton Shterenlikht =
<mexas@bristol.ac.uk> wrote:
>=20
> 	> I have a laptop with FreeBSD -current,
> 	> with ip address assigned via DHCP.
> 	> The laptop has neither a static ip address,
> 	> nor a domain.
> 	>=20
> 	> I can ping the laptop fine, but cannot
> 	> ssh into it. The sshd is running, /etc/ssh/ssd_config
> 	> seems fine, /etc/hosts.allow is fine.
> 	> However, /etc/hosts is just the default:
> 	>=20
> 	> #
> 	> ::1                     localhost localhost.my.domain
> 	> 127.0.0.1               localhost localhost.my.domain
> 	> #
> 	>=20
> 	> Is it the lack of a domain that prevents
> 	> me from getting ssh access?
> 	> I try to ssh with just a dynamic ip address,
> 	> for which ping seems to work fine.
> 	> Or is the problem somewhere else?
> 	>=20
> 	> I'm not even sure I'm asking the right
> 	> questions.
> 	>=20
> 	> Thanks
> 	>=20
> 	> Anton
>=20
>=20
> 	First, check what ports SSH listens on:
> 	sockstat | grep ssh
>=20
> root@zzz:~ # sockstat | grep ssh
> mexas    ssh        16193 3  tcp4   172.21.220.12:20541   =
137.222.187.241:22
> root     sshd       1091  3  tcp6   *:22                  *:*
> root     sshd       1091  4  tcp4   *:22                  *:*
> root@zzz:~ #
>=20
> I also see:
>=20
> /var/log/auth.log:Feb 18 11:54:25 zzz sshd[1091]: Server listening on =
:: port 22
> .
> /var/log/auth.log:Feb 18 11:54:25 zzz sshd[1091]: Server listening on =
0.0.0.0 po
> rt 22.
>=20
> Is 0.0.0.0 expected?
>=20

0.0.0.0 =3D * =3D all IPs / interfaces



> Anything else I should check in the logs?
>=20

Not that I'm aware of



>=20
> 	Then, assuming SSH indeed listens on *:22 ,
> 	 check if you have a firewall running that
> 	 could be preventing packets from reaching your box.
>=20
> I don't think so.
> There's nothing in the kernel config
>=20
> 	By the way, do you get a login prompt at all,
> 	 over SSH, or just a plain timeout or connection reset ?
>=20
> Just a timeout:
>=20
> root@zzz:~ # ifconfig wlan0
> wlan0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 =
mtu 1500
>        ether 00:21:5c:50:68:c3
>        inet 172.21.220.12 netmask 0xfffffc00 broadcast 255.255.255.255
>        nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
>        media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g
>        status: associated
>        ssid eduroam channel 1 (2412 MHz 11g) bssid 00:3a:98:62:cd:a0
>        country US authmode WPA2/802.11i privacy ON deftxkey UNDEF
>        AES-CCM 2:128-bit AES-CCM 3:128-bit txpower 14 bmiss 10 =
scanvalid 450
>        bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5
>        protmode CTS wme roaming MANUAL
> root@zzz:~ #
>=20
> TZAV> ping 172.21.220.12
> PING 172.21.220.12 (172.21.220.12): 56 data bytes
> 64 bytes from 172.21.220.12: icmp_seq=3D0 ttl=3D60 time=3D2.056 ms
> 64 bytes from 172.21.220.12: icmp_seq=3D1 ttl=3D60 time=3D1.766 ms
> ^C
>=20
> TZAV> ssh 172.21.220.12
> ssh: connect to host 172.21.220.12 port 22: Operation timed out
> TZAV>
>=20
> Thanks
>=20
> Anton
>=20



Run this on your server:

tcpdump -ni wlan0 ip and port 22



Then try to ssh to the box, see if SYN packets arrive, see if your box =
sends SYN/ACK back.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9A8F9CCD-C90B-4033-992F-0458D6128005>