cannot ssh into a box with DHCP assigned IP address

Anton Shterenlikht mexas at
Wed Feb 20 09:46:03 UTC 2013

	From: Fleuriot Damien <ml at>
	To: mexas at
	Subject: Re: cannot ssh into a box with DHCP assigned IP address
	Date: Wed, 20 Feb 2013 10:31:22 +0100
	Cc: freebsd-questions at

	On Feb 20, 2013, at 10:28 AM, Anton Shterenlikht <mexas at> wrote:

	> I have a laptop with FreeBSD -current,
	> with ip address assigned via DHCP.
	> The laptop has neither a static ip address,
	> nor a domain.
	> 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:
	> #
	> ::1                     localhost
	>               localhost
	> #
	> 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?
	> I'm not even sure I'm asking the right
	> questions.
	> Thanks
	> Anton

	First, check what ports SSH listens on:
	sockstat | grep ssh

root at zzz:~ # sockstat | grep ssh
mexas    ssh        16193 3  tcp4
root     sshd       1091  3  tcp6   *:22                  *:*
root     sshd       1091  4  tcp4   *:22                  *:*
root at zzz:~ #

I also see:

/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 po
rt 22.

Is expected?

Anything else I should check in the logs?

	Then, assuming SSH indeed listens on *:22 ,
	 check if you have a firewall running that
	 could be preventing packets from reaching your box.

I don't think so.
There's nothing in the kernel config

	By the way, do you get a login prompt at all,
	 over SSH, or just a plain timeout or connection reset ?

Just a timeout:

root at zzz:~ # ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:21:5c:50:68:c3
        inet netmask 0xfffffc00 broadcast
        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 at zzz:~ #

TZAV> ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=60 time=2.056 ms
64 bytes from icmp_seq=1 ttl=60 time=1.766 ms

TZAV> ssh
ssh: connect to host port 22: Operation timed out



More information about the freebsd-questions mailing list