From owner-freebsd-questions@FreeBSD.ORG Wed Feb 20 09:46:03 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E1C13762 for ; Wed, 20 Feb 2013 09:46:03 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirj.bris.ac.uk (dirj.bris.ac.uk [137.222.10.78]) by mx1.freebsd.org (Postfix) with ESMTP id 83A6BF92 for ; Wed, 20 Feb 2013 09:46:03 +0000 (UTC) Received: from irix.bris.ac.uk ([137.222.10.39] helo=ncs.bris.ac.uk) by dirj.bris.ac.uk with esmtp (Exim 4.72) (envelope-from ) id 1U86FN-0003Jo-9j; Wed, 20 Feb 2013 09:46:02 +0000 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncs.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1U86FM-0000al-Iw; Wed, 20 Feb 2013 09:45:52 +0000 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.6/8.14.6) with ESMTP id r1K9jq7P029537; Wed, 20 Feb 2013 09:45:52 GMT (envelope-from mexas@mech-cluster241.men.bris.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.6/8.14.6/Submit) id r1K9jpq7029535; Wed, 20 Feb 2013 09:45:52 GMT (envelope-from mexas) Date: Wed, 20 Feb 2013 09:45:52 GMT From: Anton Shterenlikht Message-Id: <201302200945.r1K9jpq7029535@mech-cluster241.men.bris.ac.uk> To: mexas@bristol.ac.uk, ml@my.gd Subject: Re: cannot ssh into a box with DHCP assigned IP address In-Reply-To: <96231D6F-D725-46F8-A9EC-23DBD7FC523E@my.gd> X-Spam-Score: -3.8 X-Spam-Level: --- Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: mexas@bristol.ac.uk List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2013 09:46:03 -0000 From: Fleuriot Damien 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 On Feb 20, 2013, at 10:28 AM, Anton Shterenlikht 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.my.domain > 127.0.0.1 localhost localhost.my.domain > # > > 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@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:~ # 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 0.0.0.0 po rt 22. Is 0.0.0.0 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@zzz:~ # ifconfig wlan0 wlan0: flags=8843 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=29 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:~ # 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=0 ttl=60 time=2.056 ms 64 bytes from 172.21.220.12: icmp_seq=1 ttl=60 time=1.766 ms ^C TZAV> ssh 172.21.220.12 ssh: connect to host 172.21.220.12 port 22: Operation timed out TZAV> Thanks Anton