From owner-freebsd-questions@FreeBSD.ORG Tue Jan 8 21:28:49 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6397216A419 for ; Tue, 8 Jan 2008 21:28:49 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.187.76.162]) by mx1.freebsd.org (Postfix) with ESMTP id 208AE13C4CC for ; Tue, 8 Jan 2008 21:28:47 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) by smtp.infracaninophile.co.uk (8.14.2/8.14.2) with ESMTP id m08L42JJ093126; Tue, 8 Jan 2008 21:04:03 GMT (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.4.2 smtp.infracaninophile.co.uk m08L42JJ093126 Authentication-Results: smtp.infracaninophile.co.uk; dkim=hardfail (SSP) header.i=unknown Message-ID: <4783E542.5090206@infracaninophile.co.uk> Date: Tue, 08 Jan 2008 21:04:02 +0000 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.9 (X11/20071122) MIME-Version: 1.0 To: ivan dimitrov References: <18977.72671.qm@web56812.mail.re3.yahoo.com> In-Reply-To: <18977.72671.qm@web56812.mail.re3.yahoo.com> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (smtp.infracaninophile.co.uk [IPv6:::1]); Tue, 08 Jan 2008 21:04:03 +0000 (GMT) X-Virus-Scanned: ClamAV 0.92/5443/Tue Jan 8 17:35:47 2008 on happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on happy-idiot-talk.infracaninophile.co.uk Cc: freebsd-questions@freebsd.org Subject: Re: how to start one daemon twice from the rc.conf? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2008 21:28:49 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 ivan dimitrov wrote: > How to start two sshd with different configs from the rc.conf? > > Do i have to write a secondary /etc/rc.d/sshd, > for eg. /etc/rc.d/sshd2 and put sshd2_enable="yes" in the rc.conf > or there is another way to do this? No -- that's pretty much the way of it unless the rc file specifically has support for multiple sessions (eg. /etc/rc.d/jail) You need to do more than just rename the file though -- you will need to change the line: name="sshd" to read name="sshd2" plus you'll need to change the line command="/usr/sbin/${name}" to say command="/usr/sbin/sshd" and add sshd2_enable="YES" sshd2_flags="-f /etc/ssh/sshd2_config" to /etc/rc.conf -- assuming you're happy to use the same keys as for the other sshd instance that's pretty much all that's necessary. In the general case though you'ld have to do a sweep through the file and change any variables from sshd_foo to sshd2_foo -- usually there are a number of references like that, and /etc/rc.d/sshd is quite unusual in not having them. Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHg+VC8Mjk52CukIwRCC7AAJ9Q4ckg6xfyB1Sv2gGqnMpPiAIKIwCdHo4Z HLoVnrPpraFIDFW8jGA9ilw= =Hwqd -----END PGP SIGNATURE-----