Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Oct 2011 15:50:40 GMT
From:      John Blazek <freebsd.org@logicalsolutns.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/161714: SSHD starts on boot even if  sshd_enable="NO" in 8.2
Message-ID:  <201110161550.p9GFoeMj039110@red.freebsd.org>
Resent-Message-ID: <201110161600.p9GG0Nab084615@freefall.freebsd.org>

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

>Number:         161714
>Category:       misc
>Synopsis:       SSHD starts on boot even if  sshd_enable="NO" in 8.2
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 16 16:00:23 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     John Blazek
>Release:        8.2
>Organization:
>Environment:
>Description:
Followup to previous report:

After tracking this down further, it appears to be directly related to an entry in /etc/rc.local

/usr/sbin/sshd -p 22200


This entry is intended to start a separate instance of sshd for administrator access.

When this entry is commented out with hash #, no sshd process starts.
When the hash is removed, sshd starts on both port 22200 and port 9991


*BOOTED WITH #/usr/sbin/sshd -p 22200  in rc.local
[root@kahlua]:[~]# cat /etc/rc.local
#/usr/sbin/sshd -p 22200
sysctl kern.securelevel=2



result: no sshd running. inetd listening on 2220

[root@kahlua]:[~]# sockstat | grep ssh
[root@kahlua]:[~]# sockstat | grep 2220
root     inetd      45432 5  tcp4   *:2220                *:*
[root@kahlua]:[~]#


Then manually executing the command starts sshd as expected:

[root@kahlua]:[~]# /usr/sbin/sshd -p 22200
[root@kahlua]:[~]# sockstat | grep ssh
root     sshd       56999 3  tcp6   *:22200               *:*
root     sshd       56999 4  tcp4   *:22200               *:*
[root@kahlua]:[~]#


*************************************************************************

Removed Hash from rc.local, to start copy of ssh on port 22200

[root@kahlua]:[~]# cat /etc/rc.local
/usr/sbin/sshd -p 22200
sysctl kern.securelevel=2
[root@kahlua]:[~]#


This resulted in an 'extra' copy of sshd starting (using the flag -p 9991 from rc.conf)

[root@kahlua]:[~]# cat /etc/rc.conf | grep ssh
# sshd is controlleb by inetd
sshd_enable="NO"
sshd_flags="-p 9991"


[root@kahlua]:[~]# sockstat | grep ssh
root     sshd       33493 3  tcp6   *:9991                *:*
root     sshd       33493 4  tcp4   *:9991                *:*
root     sshd       7532  3  tcp6   *:22200               *:*
root     sshd       7532  4  tcp4   *:22200               *:*

[root@kahlua]:[~]# sockstat | grep 2220
root     inetd      49601 5  tcp4   *:2220                *:*
root     sshd       7532  3  tcp6   *:22200               *:*
root     sshd       7532  4  tcp4   *:22200               *:*

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110161550.p9GFoeMj039110>