Q: SSHD keeps failing to open PTY

Borre 'Wouse' Sanders borre@chello.nl
Tue Nov 30 23:39:00 GMT 1999


At 10:58 PM 11/22/99 +0100, Larry Hall (RFK Partners, Inc) wrote:

> >Hello,
> >
> >I've been trying to use several Cygnus ports of different versions of 
> >sshd on a Windows NT machine, but have not been quite succesful 
> >in opening interactive sessions. I hope this is an appropriate place 
> >to ask for help, as it has proven to be very hard to find accurate and 
> >up to date information regarding the usage of such ports.
> >
> >Every time sshd seems to break down, apparently because it fails 
> >to allocate a pty. Below are two debug info examples based on 
> >V1.2.22 and V1.2.27:
> >
> >Example 1:
> >========
> >ssh-1.2.22 for Win32, compiled using Cygwin32 Beta 19.1
> >by Raju Mathur (raju@sgi.com) aka OldMonk
> >debug: sshd version 1.2.22 []
> >debug: Initializing random number generator; seed file 
> >/etc/ssh_random_seed
> >log: Server listening on port 22.
> >log: Generating 768 bit RSA key.
> >log: RSA key generation complete.
> >debug: Server will not fork when running in debugging mode.
> >log: Connection from 192.168.0.1 port 2449
> >debug: Client protocol version 1.5; client software version 1.2.27
> >debug: Sent 768 bit public key and 1024 bit host key.
> >debug: Encryption type: idea
> >debug: Received session key; encryption turned on.
> >debug: Attempting authentication for borre.
> >debug: Login for user borre accepted without authentication.
> >debug: Allocating pty.
> >error: Failed to allocate pty. <-- TROUBLE!
> >debug: Forking shell.
> >debug: Entering interactive session.
> >
> >Example 2:
> >========
> >debug: sshd version 1.2.27 []
> >debug: Initializing random number generator; seed file 
> >/etc/ssh_random_seed
> >log: Server listening on port 22.
> >log: Generating 768 bit RSA key.
> >Generating p:  .......++ (distance 76)
> >Generating q:  ...................++ (distance 364)
> >Computing the keys...
> >Testing the keys...
> >Key generation complete.
> >log: RSA key generation complete.
> >debug: Server will not fork when running in debugging mode.
> >log: Connection from 192.168.0.1 port 2482
> >debug: Client protocol version 1.5; client software version 1.2.27
> >debug: Sent 768 bit public key and 1024 bit host key.
> >debug: Encryption type: idea
> >debug: Received session key; encryption turned on.
> >debug: Installing crc compensation attack detector.
> >debug: Attempting authentication for borre.
> >log: Password authentication for borre accepted.
> >debug: Allocating pty.
> >debug: Forking shell.
> >debug: Entering interactive session.
> >error: Failed to disconnect from controlling tty. <-- TROUBLE!
> >debug: End of interactive session; stdin 0, stdout (read 0, sent 0), 
> >stderr 0 bytes.
> >debug: pty_cleanup_proc called
> >debug: chown /dev/tty0 0 0 failed: Function not implemented
> >debug: chmod /dev/tty0 0666 failed: No such file or directory
> >debug: Command exited with status 0.
> >debug: Received exit confirmation.
> >log: Closing connection to 192.168.0.1
> >============ end of examples ============
> >
> >I would like to know why the pty allocation fails. What affects pty 
> >allocation? How may I solve the allocation problem (if that's what 
> >the problem is)? I've read several problem reports similar to mine, 
> >even by people on this list, but I have NOT been able to resolve the 
> >problem yet by using the suggestions done there. Do you happen 
> >to know of an accurate and detailed Cygnus port specific sshd 
> >FAQ?
> >
> >Below is the sshd_config I used for all sshd versions I tested:
> >
> ># This is sshd server systemwide configuration file.
> >Port 22
> >ListenAddress 0.0.0.0
> >HostKey /etc/ssh_host_key
> >RandomSeed /etc/ssh_random_seed
> >ServerKeyBits 768
> >LoginGraceTime 600
> >KeyRegenerationInterval 3600
> >PermitRootLogin yes
> >IdleTimeout 10m <--- NOT TOO SHORT!
> >IgnoreRhosts yes
> >StrictModes yes
> >QuietMode no
> >X11Forwarding yes
> >X11DisplayOffset 10
> >FascistLogging yes
> >PrintMotd yes
> >KeepAlive yes
> >SyslogFacility DAEMON
> >RhostsAuthentication no
> >RhostsRSAAuthentication no
> >RSAAuthentication yes
> >PasswordAuthentication yes
> >PermitEmptyPasswords yes
> >PrintMotd yes
> >UseLogin no
> >Umask 022
> >SilentDeny no
> >
> >Regards and thanks in advance for any cooperation,
> >Borre Sanders
> >
> 
> 
> It would help to know more about your installation.  My guess is that
> you need to set "tty" in your CYGWIN environment variable but whether 
> you should need to do this or not depends on what version of Cygwin
> you are running.  If this doesn't help, send the output of cygcheck 
> to the list.
> 

OK: cygcheck -s results are presented below (without CYGWIN 
environment variable)

Cygnus Win95/NT Configuration Diagnostics
Current System Time: Wed Nov 24 21:47:37 1999

WinNT Ver 4.0 build 1381 Service Pack 6

Path:	/extra
	/bin
	/WINDOWS/system32
	/WINDOWS
	/TEXMF/MIKTEX/BIN
	/unix
	/BC5/BIN

SysDir: C:\WINDOWS\System32
WinDir: C:\WINDOWS

HOME = `//D/Borre/profile'
MAKE_MODE = `UNIX'
USER = `Borre'

Use `-r' to scan registry

a:\ fd           N/A    N/A                    
c:\ hd  NTFS    1489Mb  77% CP CS UN PA FC     C-DISK
d:\ hd  NTFS     710Mb  30% CP CS UN PA FC     D-DISK
e:\ hd  NTFS     849Mb  73% CP CS UN PA FC     E-DISK
f:\ hd  FAT      511Mb  36% CP    UN           F-DISK
g:\ hd  NTFS     749Mb   2% CP CS UN PA FC     G-DISK
h:\ cd           N/A    N/A                    
i:\ cd           N/A    N/A                    
j:\ cd           N/A    N/A                    

C:                                        /         native  text!=binary
C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin  /bin      native  text!=binary
\\.\a:                                    /dev/fd0  native  text!=binary
\\.\b:                                    /dev/fd1  native  text!=binary
\\.\tape0:                                /dev/st0  native  text!=binary
\\.\tape1:                                /dev/st1  native  text!=binary
C:\Unix\etc                               /etc      native  text!=binary
C:\Unix\qub                               /qub      native  text!=binary
F:\Temp                                   /tmp      native  text!=binary
C:\Unix\usr                               /usr      native  text!=binary
C:\Unix\var                               /var      native  text!=binary

Found: C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\bash.exe
Found: C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\cat.exe
Not Found: cpp (good!)
Found: C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\find.exe
Found: C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\gcc.exe
Found: C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\gdb.exe
Found: C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\ld.exe
Found: C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\ls.exe
Found: C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\make.exe
Found: C:\BC5\BIN\make.exe
Found: C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\sh.exe

  541k 1999/11/22 .\cygwin1.dll
  649k 1998/07/31 .\cygwinb19.dll
  541k 1999/11/22 .\cygwin1.dll
  649k 1998/07/31 .\cygwinb19.dll
  371k 1998/12/01 C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\cygtcl80.dll
    5k 1998/12/01 C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\cygtclpip80.dll
   10k 1998/12/01 C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\cygtclreg80.dll
  600k 1998/12/01 C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\cygtk80.dll
  446k 1998/12/03 C:\Cygnus\cygwin-b20\H-i586-cygwin32\bin\cygwin1.dll
  541k 1999/11/22 C:\unix\cygwin1.dll
  649k 1998/07/31 C:\unix\cygwinb19.dll
Use -h to see help about each section
============ end of cygcheck results ===========

I've tried adding the cygwin variable (used to be set in .bashrc) in 
the global NT environment, but it did not solve my problem. In 
V1.2.27 the sshd log changed in the sense that the PTY allocation 
itself does no longer seem to fail.

log: Password authentication for borre accepted.
debug: Allocating pty.
debug: Forking shell.
debug: Entering interactive session.
debug: End of interactive session; stdin 0, stdout (read 0, sent 0), 
stderr 0 bytes.
debug: pty_cleanup_proc called
debug: chown /dev/tty1 0 0 failed: Function not implemented
debug: chmod /dev/tty1 0666 failed: No such file or directory

So I still end up having no shell prompt in the end...
Anybody who's got a clue, please help. Thanks in advance for your 
cooperation.

Regards,
Borre

---------------------------------------- -----------------------------
 Borre Sanders                   Office: T.U. Eindhoven, EH 10.20
 W. de Zwijgerstraat 28           Phone: +31 (40) 247 5816
 5616 AE  EINDHOVEN              E-mail: borre@ics.ele.tue.nl
 the Netherlands              Liability: Views and opinions expressed
                                         in this message are my own.
Phone: +31 (40) 2452585                  They do not necessarily
  WWW:  http://www.chello.nl/~l.sanders  represent those of the SAI.
---------------------------------------- -----------------------------

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list