SSH server does not kill child processes upon logout on Windows Server 2003 install

Bruno Antunes sardaukar.siet@gmail.com
Wed Mar 7 14:26:00 GMT 2007


Dear All,


I have installed cygwin yesterday, March 6th 2007 and I have it
running with perfect logging and even public key authentication. So
far, so good.

Today, after an initial trial use, I started getting "could not
allocate pty" errors, that can be explained by the huge amount of
ssh.exe and scp.exe processes left running on the server – they don't
take up CPU but they do take up RAM (about 2/3MB each). What can be
the problem? Restarting the service does no good – basically the
processes aren't killed when the user logs off. This can, forseeably
cause problems. The user running the service is the one created by
ssh-server-config.

sshd_config :

#     $OpenBSD: sshd_config,v 1.74 2006/07/19 13:07:10 dtucker Exp $
# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/bin:/usr/sbin:/sbin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.
Port 22
#Protocol 2,1
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
# HostKey for protocol version 1
#HostKey /etc/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh_host_rsa_key
#HostKey /etc/ssh_host_dsa_key
# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 768
# Logging
# obsoletes QuietMode and FascistLogging
SyslogFacility AUTH
LogLevel VERBOSE
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin yes
StrictModes no
#MaxAuthTries 6
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile     .ssh/authorized_keys
# For this to work you will also need host keys in /etc/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
#PermitEmptyPasswords no
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM no
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
# no default banner path
#Banner /some/path
# override default of no subsystems
Subsystem   sftp  /usr/sbin/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
#     X11Forwarding no
#     AllowTcpForwarding no
#     ForceCommand cvs server


cygchek.out :
Cygwin Configuration Diagnostics

Current System Time: Wed Mar 07 13:18:35 2007

Windows 2003 Enterprise Server Ver 5.2 Build 3790 Service Pack 1

Running in Terminal Service session

Path: C:\cygwin\usr\local\bin

      C:\cygwin\bin

      C:\cygwin\bin

      C:\cygwin\usr\X11R6\bin

      c:\Perl\bin\

      c:\WINDOWS\system32

      c:\WINDOWS

      c:\WINDOWS\System32\WbemC

      C:\cygwin\Program Files\IDM Computer Solutions\UltraEdit-32

      C:\cygwin\bin

      c:\WINDOWS\system32\WBEM



Output from C:\cygwin\bin\id.exe (nontsec)

UID: 12666(bantunes)                  GID: 10513(Domain Users)

544(Administrators)                   545(Users)

11783(Administrador_Foruns)           10513(Domain Users)

12667(Equipa Gestão Problemas-Foruns) 11810(Identificacao_Fraude)

12124(TVCABOHDI_AD_Netcabo_Readers)



Output from C:\cygwin\bin\id.exe (ntsec)

UID: 12666(bantunes)                  GID: 10513(Domain Users)

544(Administrators)                   545(Users)

11783(Administrador_Foruns)           10513(Domain Users)

12667(Equipa Gestão Problemas-Foruns) 11810(Identificacao_Fraude)

12124(TVCABOHDI_AD_Netcabo_Readers)



SysDir: C:\WINDOWS\system32

WinDir: C:\WINDOWS



USER = 'bantunes'

PWD = '/home/bantunes'

CYGWIN = 'ntsec tty'

HOME = '/home/bantunes'

MAKE_MODE = 'unix'



HOMEPATH = '\Documents and Settings\bantunes'

MANPATH = '/usr/local/man:/usr/share/man:/usr/man::/usr/ssl/man'

APPDATA = 'C:\Documents and Settings\bantunes\Application Data'

HOSTNAME = 'scripts01pc01'

TERM = 'cygwin'

PROCESSOR_IDENTIFIER = 'x86 Family 15 Model 33 Stepping 2, AuthenticAMD'

WINDIR = 'C:\WINDOWS'

DIRCMD = '/o:gn'

OLDPWD = '/usr/bin'

USERDOMAIN = 'HDIMNG'

OS = 'Windows_NT'

ALLUSERSPROFILE = 'C:\Documents and Settings\All Users'

!:: = '::\'

TEMP = '/c/DOCUME~1/bantunes/LOCALS~1/Temp/1'

COMMONPROGRAMFILES = 'C:\Program Files\Common Files'

USERNAME = 'bantunes'

CLUSTERLOG = 'C:\WINDOWS\Cluster\cluster.log'

PROCESSOR_LEVEL = '15'

FP_NO_HOST_CHECK = 'NO'

SYSTEMDRIVE = 'C:'

USERPROFILE = 'C:\Documents and Settings\bantunes'

CLIENTNAME = 'PORTINARI'

PS1 = '\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '

LOGONSERVER = '\\HDIMNG01'

PROCESSOR_ARCHITECTURE = 'x86'

!C: = 'C:\cygwin\bin'

SHLVL = '1'

USERDNSDOMAIN = 'MNG.HDI.TVCABO'

PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'

HOMEDRIVE = 'C:'

PROMPT = '$P$G'

COMSPEC = 'C:\WINDOWS\system32\cmd.exe'

TMP = '/c/DOCUME~1/bantunes/LOCALS~1/Temp/1'

SYSTEMROOT = 'C:\WINDOWS'

CVS_RSH = '/bin/ssh'

PROCESSOR_REVISION = '2102'

INFOPATH = '/usr/local/info:/usr/share/info:/usr/info:'

PROGRAMFILES = 'C:\Program Files'

NUMBER_OF_PROCESSORS = '4'

SESSIONNAME = 'RDP-Tcp#154'

COMPUTERNAME = 'SCRIPTS01PC01'

_ = '/usr/bin/cygcheck'

POSIXLY_CORRECT = '1'



HKEY_CURRENT_USER\Software\Cygnus Solutions

HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin

HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2

HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options

HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions

HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin

HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2

  (default) = '/'

  cygdrive flags = 0x0000002a

HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/

  (default) = 'C:\cygwin'

  flags = 0x0000000a

HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin

  (default) = 'C:\cygwin/bin'

  flags = 0x0000000a

HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib

  (default) = 'C:\cygwin/lib'

  flags = 0x0000000a

HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options



c:  hd  NTFS     34702Mb  86% CP CS UN PA FC



C:\cygwin      /         system  binmode

C:\cygwin/bin  /usr/bin  system  binmode

C:\cygwin/lib  /usr/lib  system  binmode

.              /         system  binmode,cygdrive



Found: C:\cygwin\bin\awk.exe

Found: C:\cygwin\bin\bash.exe

Found: C:\cygwin\bin\cat.exe

Found: C:\cygwin\bin\cp.exe

Not Found: cpp (good!)

Not Found: crontab

Found: C:\cygwin\bin\find.exe

Not Found: gcc

Not Found: gdb

Found: C:\cygwin\bin\grep.exe

Found: C:\cygwin\bin\kill.exe

Not Found: ld

Found: C:\cygwin\bin\ls.exe

Not Found: make

Found: C:\cygwin\bin\mv.exe

Not Found: patch

Found: c:\Perl\bin\perl.exe

Found: C:\cygwin\bin\rm.exe

Found: C:\cygwin\bin\sed.exe

Found: C:\cygwin\bin\ssh.exe

Found: C:\cygwin\bin\sh.exe

Found: C:\cygwin\bin\tar.exe

Found: C:\cygwin\bin\test.exe

Not Found: vi

Found: C:\cygwin\bin\vim.exe



   61k 2006/11/10 C:\cygwin\bin\cygbz2-1.dll - os=4.0 img=1.0 sys=4.0

                  "cygbz2-1.dll" v0.0 ts=2006/11/10 23:42

    7k 2003/10/19 C:\cygwin\bin\cygcrypt-0.dll - os=4.0 img=1.0 sys=4.0

                  "cygcrypt-0.dll" v0.0 ts=2003/10/19 8:57

 1059k 2007/02/23 C:\cygwin\bin\cygcrypto-0.9.8.dll - os=4.0 img=1.0 sys=4.0

                  "cygcrypto-0.9.8.dll" v0.0 ts=2007/2/23 17:08

   40k 2006/11/15 C:\cygwin\bin\cygform-8.dll - os=4.0 img=1.0 sys=4.0

                  "cygform-8.dll" v0.0 ts=2006/11/15 7:06

   45k 2001/04/25 C:\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0

                  "cygform5.dll" v0.0 ts=2001/4/25 6:28

   35k 2002/01/09 C:\cygwin\bin\cygform6.dll - os=4.0 img=1.0 sys=4.0

                  "cygform6.dll" v0.0 ts=2002/1/9 6:03

   48k 2003/08/09 C:\cygwin\bin\cygform7.dll - os=4.0 img=1.0 sys=4.0

                  "cygform7.dll" v0.0 ts=2003/8/9 10:25

   28k 2003/07/20 C:\cygwin\bin\cyggdbm-3.dll - os=4.0 img=1.0 sys=4.0

                  "cyggdbm-3.dll" v0.0 ts=2003/7/20 8:58

   19k 2006/11/19 C:\cygwin\bin\cyggdbm-4.dll - os=4.0 img=1.0 sys=4.0

                  "cyggdbm-4.dll" v0.0 ts=2006/11/19 8:18

   19k 2003/03/22 C:\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0

                  "cyggdbm.dll" v0.0 ts=2002/2/20 3:05

   15k 2003/07/20 C:\cygwin\bin\cyggdbm_compat-3.dll - os=4.0 img=1.0 sys=4.0

                  "cyggdbm_compat-3.dll" v0.0 ts=2003/7/20 9:00

    8k 2006/11/19 C:\cygwin\bin\cyggdbm_compat-4.dll - os=4.0 img=1.0 sys=4.0

                  "cyggdbm_compat-4.dll" v0.0 ts=2006/11/19 8:18

   17k 2001/06/28 C:\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0

                  "cyghistory4.dll" v0.0 ts=2001/1/7 4:34

   29k 2003/08/10 C:\cygwin\bin\cyghistory5.dll - os=4.0 img=1.0 sys=4.0

                  "cyghistory5.dll" v0.0 ts=2003/8/11 0:16

   25k 2007/01/18 C:\cygwin\bin\cyghistory6.dll - os=4.0 img=1.0 sys=4.0

                  "cyghistory6.dll" v0.0 ts=2007/1/18 3:14

  976k 2006/10/22 C:\cygwin\bin\cygiconv-2.dll - os=4.0 img=1.0 sys=4.0

                  "cygiconv-2.dll" v0.0 ts=2006/10/23 0:44

   22k 2001/12/13 C:\cygwin\bin\cygintl-1.dll - os=4.0 img=1.0 sys=4.0

                  "cygintl-1.dll" v0.0 ts=2001/12/13 9:28

   37k 2003/08/10 C:\cygwin\bin\cygintl-2.dll - os=4.0 img=1.0 sys=4.0

                  "cygintl-2.dll" v0.0 ts=2003/8/10 22:50

   31k 2005/11/20 C:\cygwin\bin\cygintl-3.dll - os=4.0 img=1.0 sys=4.0

                  "cygintl-3.dll" v0.0 ts=2005/11/20 2:04

   31k 2006/10/23 C:\cygwin\bin\cygintl-8.dll - os=4.0 img=1.0 sys=4.0

                  "cygintl-8.dll" v0.0 ts=2006/10/23 1:12

   21k 2001/06/20 C:\cygwin\bin\cygintl.dll - os=4.0 img=1.0 sys=4.0

                  "cygintl.dll" v0.0 ts=2001/6/20 18:09

   21k 2006/11/15 C:\cygwin\bin\cygmenu-8.dll - os=4.0 img=1.0 sys=4.0

                  "cygmenu-8.dll" v0.0 ts=2006/11/15 7:05

   26k 2001/04/25 C:\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0

                  "cygmenu5.dll" v0.0 ts=2001/4/25 6:27

   20k 2002/01/09 C:\cygwin\bin\cygmenu6.dll - os=4.0 img=1.0 sys=4.0

                  "cygmenu6.dll" v0.0 ts=2002/1/9 6:03

   29k 2003/08/09 C:\cygwin\bin\cygmenu7.dll - os=4.0 img=1.0 sys=4.0

                  "cygmenu7.dll" v0.0 ts=2003/8/9 10:25

   20k 2006/12/21 C:\cygwin\bin\cygminires.dll - os=4.0 img=1.1 sys=4.0

                  "cygminires.dll" v0.0 ts=2006/12/21 5:07

   67k 2006/11/15 C:\cygwin\bin\cygncurses++-8.dll - os=4.0 img=1.0 sys=4.0

                  "cygncurses++-8.dll" v0.0 ts=2006/11/15 7:13

  156k 2001/04/25 C:\cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0

                  "cygncurses++5.dll" v0.0 ts=2001/4/25 6:29

  175k 2002/01/09 C:\cygwin\bin\cygncurses++6.dll - os=4.0 img=1.0 sys=4.0

                  "cygncurses++6.dll" v0.0 ts=2002/1/9 6:03

  237k 2006/11/15 C:\cygwin\bin\cygncurses-8.dll - os=4.0 img=1.0 sys=4.0

                  "cygncurses-8.dll" v0.0 ts=2006/11/15 7:02

  226k 2001/04/25 C:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0

                  "cygncurses5.dll" v0.0 ts=2001/4/25 6:17

  202k 2002/01/09 C:\cygwin\bin\cygncurses6.dll - os=4.0 img=1.0 sys=4.0

                  "cygncurses6.dll" v0.0 ts=2002/1/9 6:03

  224k 2003/08/09 C:\cygwin\bin\cygncurses7.dll - os=4.0 img=1.0 sys=4.0

                  "cygncurses7.dll" v0.0 ts=2003/8/9 10:24

   12k 2006/11/15 C:\cygwin\bin\cygpanel-8.dll - os=4.0 img=1.0 sys=4.0

                  "cygpanel-8.dll" v0.0 ts=2006/11/15 7:04

   15k 2001/04/25 C:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0

                  "cygpanel5.dll" v0.0 ts=2001/4/25 6:27

   12k 2002/01/09 C:\cygwin\bin\cygpanel6.dll - os=4.0 img=1.0 sys=4.0

                  "cygpanel6.dll" v0.0 ts=2002/1/9 6:03

   19k 2003/08/09 C:\cygwin\bin\cygpanel7.dll - os=4.0 img=1.0 sys=4.0

                  "cygpanel7.dll" v0.0 ts=2003/8/9 10:24

  109k 2006/02/10 C:\cygwin\bin\cygpcre-0.dll - os=4.0 img=1.0 sys=4.0

                  "cygpcre-0.dll" v0.0 ts=2006/2/10 2:37

  299k 2006/02/10 C:\cygwin\bin\cygpcrecpp-0.dll - os=4.0 img=1.0 sys=4.0

                  "cygpcrecpp-0.dll" v0.0 ts=2006/2/10 2:38

    7k 2006/02/10 C:\cygwin\bin\cygpcreposix-0.dll - os=4.0 img=1.0 sys=4.0

                  "cygpcreposix-0.dll" v0.0 ts=2006/2/10 2:37

   22k 2002/06/09 C:\cygwin\bin\cygpopt-0.dll - os=4.0 img=1.0 sys=4.0

                  "cygpopt-0.dll" v0.0 ts=2002/6/9 6:45

  108k 2001/06/28 C:\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0

                  "cygreadline4.dll" v0.0 ts=2001/1/7 4:34

  148k 2003/08/10 C:\cygwin\bin\cygreadline5.dll - os=4.0 img=1.0 sys=4.0

                  "cygreadline5.dll" v0.0 ts=2003/8/11 0:16

  154k 2007/01/18 C:\cygwin\bin\cygreadline6.dll - os=4.0 img=1.0 sys=4.0

                  "cygreadline6.dll" v0.0 ts=2007/1/18 3:14

  217k 2007/02/23 C:\cygwin\bin\cygssl-0.9.8.dll - os=4.0 img=1.0 sys=4.0

                  "cygssl-0.9.8.dll" v0.0 ts=2007/2/23 17:08

   65k 2006/10/16 C:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0

                  "cygz.dll" v0.0 ts=2006/10/16 2:10

 1830k 2007/01/31 C:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0

                  "cygwin1.dll" v0.0 ts=2007/1/31 9:58

    Cygwin DLL version info:

        DLL version: 1.5.24

        DLL epoch: 19

        DLL bad signal mask: 19005

        DLL old termios: 5

        DLL malloc env: 28

        API major: 0

        API minor: 156

        Shared data: 4

        DLL identifier: cygwin1

        Mount registry: 2

        Cygnus registry name: Cygnus Solutions

        Cygwin registry name: Cygwin

        Program options name: Program Options

        Cygwin mount registry name: mounts v2

        Cygdrive flags: cygdrive flags

        Cygdrive prefix: cygdrive prefix

        Cygdrive default prefix:

        Build date: Wed Jan 31 10:57:51 CET 2007

        CVS tag: cr-0x5f1

        Shared id: cygwin1S4





Service             : sshd

Display name        : CYGWIN sshd

Current State       : Running

Controls Accepted   : Stop

Command             : /usr/sbin/sshd -D

stdin path          : /dev/null

stdout path         : /var/log/sshd.log

stderr path         : /var/log/sshd.log

Environment         : CYGWIN="ntsec tty"

Process Type        : Own Process

Startup             : Automatic

Dependencies        : tcpip

Account             : .\sshd_server





Cygwin Package Information

Last downloaded files to: C:\Documents and Settings\bantunes\Desktop\cyg-pgks

Last downloaded files from:
http://bo.mirror.garr.it/mirrors/sourceware.org/cygwin



Package              Version

_update-info-dir     00501-1

alternatives         1.3.29a-1

ash                  20040127-3

base-files           3.7-1

base-passwd          2.2-1

bash                 3.2.9-11

bzip2                1.0.3-2

coreutils            6.7-2

crypt                1.1-1

cygrunsrv            1.17-1

cygutils             1.3.1-1

cygwin               1.5.24-2

cygwin-doc           1.4-4

diffutils            2.8.7-1

editrights           1.01-1

findutils            4.3.2-3

gawk                 3.1.5-4

gdbm                 1.8.3-8

grep                 2.5.1a-2

groff                1.18.1-2

gzip                 1.3.9-1

less                 381-1

libbz2_1             1.0.3-2

libgdbm              1.8.0-5

libgdbm-devel        1.8.3-8

libgdbm3             1.8.3-3

libgdbm4             1.8.3-8

libiconv2            1.11-1

libintl              0.10.38-3

libintl1             0.10.40-1

libintl2             0.12.1-3

libintl3             0.14.5-1

libintl8             0.15-1

libncurses5          5.2-1

libncurses6          5.2-8

libncurses7          5.3-4

libncurses8          5.5-3

libpcre0             6.6-1

libpopt0             1.6.4-4

libreadline4         4.1-2

libreadline5         4.3-5

libreadline6         5.2.1-6

login                1.9-7

man                  1.6d-2

minires              1.01-1

mktemp               1.5-4

ncurses              5.5-3

openssh              4.5p1-1

openssl              0.9.8e-1

run                  1.1.10-1

sed                  4.1.5-2

tar                  1.16.1-1

tcp_wrappers         7.6-1

termcap              20050421-1

terminfo             5.5_20061104-1

texinfo              4.8-4

vim                  7.0.122-1

which                1.7-1

zlib                 1.2.3-2

Use -h to see help about each section





Thanks for any help!



-- 
sardaukar_siet
http://iruel.net
---------------------------------------
Israfel's Retreat BBS
Fidonet 2:550/36
ssh://sbbs:sbbs@twinturbo.ath.cx


More information about the Cygwin mailing list