delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/12/05/15:18:03

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:reply-to:subject:to:references:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=vdbrIOA/idLi5449
xxE6dTqYdaSdJhe4LY9qSYVL7KoMGNWXh68sUZaYP9gAUhIR3M1wL6SzU54sy+z+
L3Ps6PiuhvoW5fv844bdwNUiwztsS4sw+atqL6GoXEKCExFMFVKsYMjvsz2TY1kb
CzJNRoarLbgiWwVTjw+AiPS5f+k=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:reply-to:subject:to:references:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=vaTH1QE/si/VdW3NFfDDEA
tpnYg=; b=bRYLFI1/nDXGbWDIpmQZccCC2KwWZ7hGYarRi/0rxtCjBbCZuCe72y
Cp1uF+Ih9dBrTo7N94NFV4ZqtcfQdnNN2RCBC1h3dxX0Fa93IMy1Nwl0wq8wVHeV
LwGJ67WwE1GDQtHXHo+0Bykn1OwvSZm3/NoBsd+ycV8MHr5eTm5Pc=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=H*R:D*ca, calgary, Calgary, Alberta
X-HELO: smtp-out-so.shaw.ca
X-Authority-Analysis: v=2.2 cv=a9pAzQaF c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=N659UExz7-8A:10 a=A1X0JdhQAAAA:8 a=sI74QSVfNkpkVSIq9h4A:9 a=pILNOxqGKmIA:10 a=Df3jFdWbhGDLdZNm0fyq:22
Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca
Subject: Re: Cygwin sshd doesn't use domain user names on boot up
To: cygwin AT cygwin DOT com
References: <40190877-370C-45C1-9D35-50B88A67AA4A AT cisco DOT com>
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Message-ID: <6a47b6c6-032a-37d0-fe56-2ae21e6a5a68@SystematicSw.ab.ca>
Date: Tue, 5 Dec 2017 13:17:47 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0
MIME-Version: 1.0
In-Reply-To: <40190877-370C-45C1-9D35-50B88A67AA4A@cisco.com>
X-CMAE-Envelope: MS4wfDtwLggCqWiTOeE/UvOmRn2/uMbVMkqOpKWz7D7TtN6E5IULPe6q47XZm/IEcP1EgFJ4WaMDMiVIUp2mke5RCQmMbqdHsb/T+T+hfdkmyioZNngvNe30 eW9N+ob5em09oF5QF+TegRGEu/aPQPuifCq4pfMJ4EhpHCMSjzU72mXyAyCAxpwyTuv6CY53vdqKsw==
X-IsSubscribed: yes

On 2017-12-05 12:24, Chris Wilson (chwilso3) wrote:
> I'm trying to set up sshd service on a Windows 10 build slave VM (for use 
> with Jenkins) which is attached to one of the domains in our network. I
> initially ran the ssh-host-config script to generate the cyg_server user and
> I was able to start the sshd service on Windows. Assuming that the Windows
> user is DOMAIN\myuser (real info redacted), I was able to SSH into the
> machine and the shell prompt shows up correctly:
> myuser AT build-slave DOT example DOT com ~
> $ pwd
> /home/myuser
> However, after I reboot the machine, the username that shows up in the
> prompt changes to the following:
> DOMAIN+User(1234567)@build-slave.example.com ~
> $ pwd
> /home/myuser
> If I simply restart the sshd service once the machine is booted, the
> username changes back from "DOMAIN+User(1234567)" --> "myuser":
> # restart sshd
> $ net stop sshd
> $ net start sshd
> # prompt is fixed now
> myuser AT build-slave DOT example DOT com ~
> $ pwd
> /home/myuser
> Anybody have an idea what's going on here? I'm not sure why the username 
> isn't picked up correctly when sshd starts up initially after a reboot. Is
> there some kind of dependency that needs to be added to the sshd service on boot?

Did you install the service by running ssh-host-config?

Check service dependencies with:
$ cygrunsrv -VQ sshd
Service             : sshd
Display name        : CYGWIN sshd
Current State       : Running
Controls Accepted   : Stop, Preshutdown
Command             : /usr/sbin/sshd -D
stdin path          : /dev/null
stdout path         : /var/log/sshd.log
stderr path         : /var/log/sshd.log
Process Type        : Own Process
Startup             : Manual
Dependencies        : cygserver, tcpip
Account             : .\cyg_server

You may have to add an additional dependency on netlogon or other AD services to
ensure they are available before sshd starts.

If your service start is Automatic, you may also want to change it manually to
Automatic (delayed start), to allow time for network services to be available.

I don't run in a domain, but found it useful to tweak the Cygwin and Windows
service settings to avoid issues with startup and updates e.g. Manual start,
dependency on cygserver, Preshutdown termination before other services, shutdown
script run in a pre-setup script or on Preshutdown event, and startup script run
at boot and in an /etc/postinstall/zp_zzz_service_start.sh script after all
other setup processing.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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