[PATCH]: Add features to Cygwin's ssh-host-config script

Corinna Vinschen vinschen at redhat.com
Thu Jun 14 01:00:24 EST 2001


Hi,

I have added two features to the ssh-host-config script which is used
in Cygwin installations to prepare the host based OpenSSH configuration.

Now it cares for a /var/log/lastlog file if it's not already installed
(Thanks to "Karl M" <karlm30 at hotmail.com> for that patch) and it now
asks the user if s/he wants to install sshd as a NT service and, if so,
installs it.

Index: ssh-host-config
===================================================================
RCS file: /cvs/openssh_cvs/contrib/cygwin/ssh-host-config,v
retrieving revision 1.2
diff -u -p -r1.2 ssh-host-config
--- ssh-host-config	2001/03/07 10:38:19	1.2
+++ ssh-host-config	2001/06/13 14:54:31
@@ -438,6 +438,48 @@ then
   fi
 fi
 
+# Create /var/log and /var/log/lastlog if not already existing
+
+if [ -f /var/log ]
+then
+  echo "Creating /var/log failed\!"
+else
+  if [ ! -d /var/log ]
+  then
+    mkdir /var/log
+  fi
+  if [ -d /var/log/lastlog ]
+  then
+    echo "Creating /var/log/lastlog failed\!"
+  elif [ ! -f /var/log/lastlog ]
+  then
+    cat /dev/null > /var/log/lastlog
+  fi
+fi
+
+# On NT ask if sshd should be installed as service
+if [ $_nt -gt 0 ]
+then
+  echo
+  echo "Do you want to install sshd as service?"
+  if request "(Say \"no\" if it's already installed as service)"
+  then
+    echo
+    echo "Which value should the environment variable CYGWIN have when"
+    echo "sshd starts? It's recommended to set at least \"ntsec\" to be"
+    echo "able to change user context without password."
+    echo -n "Default is \"binmode ntsec tty\".  CYGWIN="
+    read _cygwin
+    [ -z "${_cygwin}" ] && _cygwin="binmode ntsec tty"
+    if cygrunsrv -I sshd -d "CYGWIN sshd" -p /usr/sbin/sshd -a -D -e "CYGWIN=${_cygwin}"
+    then
+      chown system /etc/ssh*
+      echo
+      echo "The service has been installed under LocalSystem account."
+    fi
+  fi
+fi
+
 if [ "${old_install}" = "1" ]
 then
   echo

Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen at redhat.com



More information about the openssh-unix-dev mailing list