sshd1 v1.2.26, b20.1, tty problems (most likely)

Juha Jäykkä
Mon May 10 04:04:00 GMT 1999

  So here goes my problem: When running sshd1 -d everything works fine
except that the sshd1 won't serve more than one connection request
(that's by design). sshd1 -d as run from either bash or cmd.exe, has a
positive integer TTY as reported by ps.
   When I install (with instsrv and srvany from NT resource kit) sshd1
as a service, run it with an account which has all NT user rights except
"Add workstations to domain" and try to ssh1 localhost (,
but sshd_config restricts listening to that IP, localhost is not an
allowed source for login), the following happens:

bash$ ps
   1024   0  11:24:29 /H-i586-cygwin32/bin/bash.exe
   1316  -1  13:32:54 /usr/local/sbin/sshd1.exe
   1317   1  13:32:57 /bin/ps.exe
   1087   1  11:37:20 /H-i586-cygwin32/bin/bash.exe
bash$ ssh1 bash --login -i
juhaj@'s password:
bash: no job control in this shell
ls: write error: Bad file number
bash-2.02$ logout

  (Before you begin wondering what the error from "ls" means, read the
rest of the message. Also, if I run ssh1 IP bash --login without -i, the
word displayed is not "logout" but "exit" - as is natural.)
  Now my problem is that I DID NOT type that "logout" not has it come
from any .bashrc or /etc/profile (they are catenated later). There
obviously is some reason for bash forcing a logout but I cannot figure
out any other than an EOF from stdin.
  Speculation: I suspect this EOF comes from a non-existent or
"zero-length" TTY. Now I can clearly see that sshd1.exe has a very
strange tty: -1. Can this be fixed somehow to be a natural number and is
it likely that this strange TTY number is the source of my problems?
  Any ideas are appreciated and please cc them to me as I no longer
subscribe to the list. Thanks.

  Some background (output from export is little cleaned up from my
hitachi microcontroller C-compiler env variables and such):
bash$ export
declare -x COMSPEC="C:\\WINNT\\system32\\cmd.exe"
declare -x CYGWIN="tty"
declare -x HOME="/home/JUHAJ"
declare -x HOMEDRIVE="C:"
declare -x HOMEPATH="C:\\home\\JUHAJ"
declare -x HOSTNAME="stiff"
declare -x MACHTYPE="i586-pc-cygwin32"
declare -x OSTYPE="cygwin32"
declare -x PATH="/bin:/usr/local/bin:/usr/local/sbin:/usr/X11R6.4/bin"
declare -x PS1="bash\$ "
declare -x PWD="/"
declare -x SHELL="/bin/sh"
declare -x SHLVL="1"
declare -x SYSTEMDRIVE="C:"
declare -x SYSTEMROOT="C:\\WINNT"
declare -x TEMP="C:\\TEMP"
declare -x TERM="cygwin"
declare -x TMP="C:\\TEMP"
declare -x USERNAME="JUHAJ"
declare -x USERPROFILE="C:\\WINNT\\Profiles\\juhaj"
declare -x WINDIR="C:\\WINNT"
bash$ cat /etc/profile
ls -la
export PATH=/bin:/usr/local/bin:/usr/local/sbin:/usr/X11R6.4/bin
cd /home/juhaj
bash-2.02$ logout
bash$ mount
Device           Directory           Type        Flags
c:\temp          /tmp                native      text=binary
c:\home          /home               native      text=binary
con              /dev/tty            native      text=binary
c:\cygnus\cygwin-b20 /                   native      text=binary
bash$ cat /home/juhaj/.bashrc
echo $HOME

Juha Jäykkä,
PS See for latest version of RSA in
Here goes the RSA code in two lines:
print pack"C*",split/\D+/,`echo

Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list