X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: Date: Sun, 13 Apr 2008 03:27:14 +0100 From: "Robert McKay" To: cygwin AT cygwin DOT com Subject: Re: How do I run sshd as a particular user? In-Reply-To: <20080412090648.GC23852@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6ADC05D7-7602-4123-81EF-1DE06D26E91F AT von-campe DOT com> <006301c890e8$4fa2f070$2708a8c0 AT CAM DOT ARTIMI DOT COM> <20080402132726 DOT GG4468 AT calimero DOT vinschen DOT de> <69CA7E11-E788-4149-9246-DCDF5063FBB2 AT von-campe DOT com> <20080412090648 DOT GC23852 AT calimero DOT vinschen DOT de> X-Google-Sender-Auth: 5af078efcd78c7e1 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Sat, Apr 12, 2008 at 10:06 AM, Corinna Vinschen wrote: > On Apr 12 01:11, Robert McKay wrote: > > In order to run sshd as an unprivileged user I had to use a nasty > > hexedit hack on the sshd.exe file to replace the seteuid() call (which > > fails / returns -1 without admin privileges and causes sshd to exit) > > with a call to isalpha() which has (almost) the same function > > prototype, but always returns 0 unless your userid 'is an alphanumeric > > charater' :) > > Aaaaargh! > > I don't know what you're doing wrong but this is *totally* unnecessary. > You can run sshd as unprivileged user without having to change the > sshd code. You can do this while another sshd is running on > port 22 under a privileged account. What the user has to do is to create > her own sshd_config file and own host keys. If no other sshd is running > on the machine, just chown the host key files in /etc and switch off > privilege separation in /etc/sshd_config. Interesting.. are you sure your account doesn't have the allow replace process token privilege? I'll take another look this when I get the chance.. perhaps sshd has changed in some way. Cheers, Rob. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/