delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/12/14/15:58:55

X-Spam-Check-By: sourceware.org
Message-ID: <31b7d2790612141258p3b2aa00ycf35837dfac96077@mail.gmail.com>
Date: Thu, 14 Dec 2006 20:58:35 +0000
From: "DePriest, Jason R." <jrdepriest AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: "/bin/bash: permission denied" using Cygwin ssh/sshd under WinXP 2003 x64: resolved
In-Reply-To: <elsbfo$d75$1@sea.gmane.org>
MIME-Version: 1.0
References: <elpqnt$cea$1 AT sea DOT gmane DOT org> <31b7d2790612141040n2d21f629jb0f2595dee177f6 AT mail DOT gmail DOT com> <elsbfo$d75$1 AT sea DOT gmane DOT org>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 12/14/06, Brian Kasper  wrote:
> Jason --
>
> Thanks for replying.  I've attached the output of "cygcheck -s -v -r".
>
> Frustratingly, it appears that after a reboot (required because my
> company pushed some updates to my system), ssh to localhost no longer works.
>
> If I stop the sshd service, start a command shell as "sshd_server",
> start bash in that shell, and then run "/usr/sbin/sshd -d" I can see the
> debug output from sshd.  Here's what I believe is the pertinent bit of
> that debug output:
>
> Failed none for kasper from 127.0.0.1 port 4056 ssh2
> debug1: userauth-request for user kasper service ssh-connection method
> publickey
> debug1: attempt 1 failures 1
> debug1: test whether pkalg/pkblob are acceptable
> debug1: temporarily_use_uid: 1003/513 (e=1014/513)
> seteuid 1003: Permission denied
> debug1: do_cleanup
>
> In the bash window from which I run ssh, I see this:
>
> ~ 506 $ ssh localhost
> Connection closed by 127.0.0.1
>
> It appears to be the failing "seteuid 1003" call that's the proximal
> cause of the failure.
>
> If, however, I run "/usr/sbin/sshd -d" in a command prompt + bash
> session started as user "kasper", everything works:
>
> ~ 508 $ ssh localhost
> Enter passphrase for key '/home/kasper/.ssh/id_rsa':
> Warning: No xauth data; using fake authentication data for X11 forwarding.
> Last login: Thu Dec 14 11:37:10 2006 from 127.0.0.1
> Fanfare!!!
> You are successfully logged in to this server!!!
> debug1: permanently_set_uid: 1003/513
> Environment:
> [some environment vars snipped]
>    CYGWIN=binmode ntsec tty
>    USER=kasper
>    LOGNAME=kasper
>    HOME=/home/kasper
>    MAIL=/var/spool/mail/kasper
>    SHELL=/bin/bash
>    SSH_CLIENT=127.0.0.1 4083 22
>    SSH_CONNECTION=127.0.0.1 4083 127.0.0.1 22
>    SSH_TTY=/dev/tty3
>    TERM=ansi
> Parsing .bash_profile ....  Done.
> ~ 501 $
>
> I used both ssh-host-config and ssh-user-config to set up sshd.  I did
> not use privilege separation, but I did configure sshd to run as a service.
>
> The other problems I've been seeing are a Windows "Error 1062" message
> when trying to start sshd and the "/bin/bash: permission denied" error I
> mentioned in my previous post.  I thought the "/bin/bash: permission
> denied" error was resolved, but this failure also appears to involve
> permissions.
>
> I have a feeling most if not all the problems are caused by interactions
> with the WinXP 2003 x64 security/permissions system, which I believe are
> the same as those for WinXP Server 2003.
>
> -Brian

I have a Windows 2003 Server that is 32-bit and runs sshd fine.
Cygcheck calls the host OS: Windows 2003 Enterprise Server Ver 5.2
Build 3790 Service Pack 1

Looking at the other differences between our configs, I see that my
service information for sshd is identical except for my Environment
line which is
CYGWIN="TTY NTSEC SMBNTSEC BINMODE"

The rights for my /etc/sshd_config are r--r--r-- sshd_server users.local
The rights for my /var/log/sshd.log are rw-r--r-- sshd_server none

I am ~not~ using privilege separation.

You could also try downloading Microsoft Sysinternals' Process Monitor
application.  It works on W2k3.  If you filter for 'cygwin' in the
path and run your ssh tests again, maybe you can see what specifically
is being called when the failure happens.

I don't see the set_uid lines in my debug logs which is probably
because I am not using privsep on this system.

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019