SSHD

JJ Streicher-Bremer jj@digisle.net
Wed Dec 16 16:28:00 GMT 1998


Here is the install batch file I use to install sshd on my systems along
with the appropriate reg files.  Read the readme.txt file as well.  

Let me know if there are any questions about this information.

JJ


Daniel-Wittenberg@uiowa.edu wrote:
> 
> I had a question for ya about sshd under b20.  I have been trying to get it
> to start under inetd but have been
> unsuccessful so far.  I tried creating a new user called daemon, gave it
> the appropriate privs, (run as OS, etc)
> and inetd starts ok, just no sshd...any ideas ??
> 
> Thanks!
> Dan Wittenberg
> 
> Received: from moon.uiowa.edu ([128.255.1.36]) by marker.its.uiowa.edu
>       (Lotus SMTP MTA v4.6.1  (569.2 2-6-1998)) with SMTP id
>       862566DC.004CF32D; Wed, 16 Dec 1998 08:01:30 -0600
>       Received: (from daemon@localhost)
>           by moon.uiowa.edu (8.9.1/8.9.1/its-moon-2.1) id IAA27222
>           for dan.wittenberg/unv_iowa@marker.its.uiowa.edu; Wed, 16 Dec
>       1998 08:03:26 -0600
>       Received: from cygnus.com (runyon.cygnus.com [205.180.230.5])
>           by moon.uiowa.edu (8.9.1/8.9.1/its-moon-2.1) with ESMTP id
>       IAA06716
>           for <Daniel-Wittenberg@uiowa.edu>; Wed, 16 Dec 1998 08:03:25
>       -0600
>       Received: (from majordom@localhost)
>           by runyon.cygnus.com (8.8.7-cygnus/8.8.7) id KAA15128;
>           Tue, 15 Dec 1998 10:07:14 -0800 (PST)
>       Received: from guinness.digisle.net (guinness.digisle.net
>       [167.216.152.33])
>           by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id KAA15123
>           for <gnu-win32@cygnus.com>; Tue, 15 Dec 1998 10:07:12 -0800 (PST)
> 
>       Received: from digisle.net (di-sf-dhcp-15.digisle.com
>       [167.216.154.65])
>           by guinness.digisle.net (8.8.7/8.8.7/digisle) with ESMTP id
>       IAA26065
>           for <gnu-win32@cygnus.com>; Tue, 15 Dec 1998 08:07:10 -1000 (HST)
> 
>       Message-ID: < 3676A54D.1C0194A1@digisle.net >
>       Date: Tue, 15 Dec 1998 10:07:09 -0800
>       X-PH: V4.1@moon.uiowa.edu
>       From: JJ Streicher-Bremer <jj@digisle.net>
>       X-Mailer: Mozilla 4.5 [en] (WinNT; I)
>       X-Accept-Language: en
>       MIME-Version: 1.0
>       To: gnu-win32@cygnus.com
>       Subject: /dev in B20.1
>       References: <74rYqp3ppfB@mike.franken.de>
>       Content-Type: text/plain; charset=us-ascii
>       Content-Transfer-Encoding: 7bit
>       Sender: owner-gnu-win32@cygnus.com
>       Precedence: bulk
> 
> From:     JJ Streicher-Bremer <jj@digisle.net>
> When:       12/15/98 12:07:09 PM
> 
> To:   gnu-win32@cygnus.com
> cc:    (bcc: Dan Wittenberg/UNV_IOWA)
> Subject:  /dev in B20.1
> 
> I just downloaded and installed the user tools version 20.1.  What a
> wonderful difference.  sshd runs better than ever before (faster more
> stable)!  Now I have a question about the /dev folder.  The user tools
> don't create it, yet there are quite a few messages about things in the
> /dev folder.  How do I go about creating these special files?  The main
> reason for this is to get syslogd working.
> 
> I have appended a cygcheck of my system.
> 
> Any help would be greatly appreciated.
> 
> Thanks in advance
> JJ Streicher-Bremer
> NT Systems Administrator
> Digital Island Inc.
> 
> ---------------------------------------------------------------------------
> --
> Cygnus Win95/NT Configuration Diagnostics
> Current System Time: Tue Dec 15 10:05:14 1998
> 
> WinNT Ver 4.0 build 1381 Service Pack 4
> 
> Path:   .
>         /usr/bin
>         /usr/local/bin
>         .
>         //d/apps/perl/bin
>         //d/apps/4nt
>         //d/apps/ntreskit
>         //d/apps/ntsec
>         //c/winnt/system32
>         //c/winnt
> 
> SysDir: C:\WINNT\System32
> WinDir: C:\WINNT
> 
> CYGWIN32 = `tty'
> CYGWIN = `tty binmode title strip_title glob'
> HOME = `/home/jj'
> PWD = `/dev'
> USER = `jj'
> 
> Use `-r' to scan registry
> 
> a:\ fd           N/A    N/A
> c:\ hd  FAT     1019Mb  65% CP    UN
> d:\ hd  NTFS    3726Mb  78% CP CS UN PA FC
> e:\ net NTFS    6149Mb  28% CP CS UN PA FC
> z:\ cd  CDFS     557Mb 100%    CS UN
> 
> D:\apps\Unix  /         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
> D:\users      /home     native  text=binary
> 
> Found: D:\apps\Unix\usr\bin\bash.exe
> Found: D:\apps\Unix\usr\bin\cat.exe
> Not Found: cpp (good!)
> Found: D:\apps\Unix\usr\bin\find.exe
> Not Found: gcc
> Not Found: gdb
> Not Found: ld
> Found: D:\apps\Unix\usr\bin\ls.exe
> Not Found: make
> Found: D:\apps\Unix\usr\bin\sh.exe
> 
>   446k 1998/12/15 D:\apps\Unix\usr\bin\cygwin1.dll
> -
> For help on using this list (especially unsubscribing), send a message to
> "gnu-win32-request@cygnus.com" with one line of text: "help".
mounts.reg
sshd.reg
setup.bat
Installation of sshd on Windows NT

The installation files expect to have the unix subsystem installed in d:\apps\unix.  If you wish to have the system installed in a different path you MUST edit the path in the following files:

setup.bat
sshd.reg
mounts.reg
/usr/local/sbin/sshdrc.bat (edit this file after you un-tgz the file)

To setup sshd:
1)copy all install files to d:\apps\unix (create this folder if necessarry)
2)untar unix.tgz (tar -zxvf unix.tgz)
3)run setup.bat
4)a reboot may be necessary to get the service authentication correct :-)

NOTES:
a)The service is set to autostart.
b)Initially only the administrator configured for ssh access.
c)The setup.bat file creates a local user, sshd, with an initial password.  This password can be changed by changing the user password and modifying the sshd service's startup configuration.  The sshd user is granted the following four special rights:

SeTcbPrivilege - Act as part of the operating system
SeIncreaseQuotaPrivilege - Increase quotas
SeServiceLogonRight - Logon as a service
SeAssignPrimaryTokenPrivilege - Replace a process level token



To set up a user for sshd access
1)add the user to /etc/passwd (use the command mkpasswd to do this easily)
	(example: mkpasswd -d |grep -i username >>/etc/passwd )
2)restart sshd. (kill -1 SSHDPID - the pid of the current sshd process is stored in /var/run/sshd.pid)

NOTES:
a)The folder /home is mounted to d:\users.  You can add a users folder here, put the information in the passwd file, and use .profile, .bash_login, and .bashrc to modify the users environment.
b)The shell is a GNU bash shell, as such the backspace char ( \ )is the escape char and the asterisk ( * ) is a shell wildcard.  To use a backspace or an asterisk in a command line (i.e. net use * \\server\share ) you must use double backslashes ( \\ ) and quote the asterisk ( '*' ).  A command line would become 

net use '*' \\\\server\\share

c)The shell accesses the drives via the WinNT POSIX subsystem.  Other drives are accesed via a double forward slash.  ( //c/winnt )

d)The shell uses UNIX style file format.  This means that if you edit a text file with a regular text editor it will put a ^M at the end of every line.  This will royally mess up the system.

e)The sshd authenticates users in this order:
	Checks to see if the user is in /etc/passwd
	Checks the local system for a matching user ID
	If the system is a member of a domain it checks the doamin for a matching ID



----------------------------------------------------------------------------
example .profile file

# ~/.profile --
#   The  personal  initialization  file,  executed  for login shells
#[ -e /etc/D ] && echo "~$USER/.profile" 1>&2

if [ -n "$BASH_VERSION" ]; then
  if [ -r "$HOME/.bashrc" ]; then
    # login shells are always interactive, are they?
    . $HOME/.bashrc
  fi
else
  # non-bash 'sh'-users are on their own for now...
  :
fi
TERM=ansi
export TERM
PATH=.:$PATH://d/apps/ntreskit://c/winnt/system32://c/winnt
export PATH

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mounts.reg
Type: text/x-ms-regedit
Size: 3333 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/19981216/c17d8fd7/attachment.bin>
-------------- next part --------------
REM Set the CYGWIN32 env variable
setx CYGWIN32 tty -m

REM Set up the mount points
regedit /s mounts.reg

REM Create the sshd user and assign the necessarry rights
net user sshd /del
net user sshd password /add
net user sshd password
ntrights +r SeTcbPrivilege -u sshd
ntrights +r SeIncreaseQuotaPrivilege -u sshd
ntrights +r SeServiceLogonRight -u sshd
ntrights +r SeAssignPrimaryTokenPrivilege -u sshd

REM Create the sshusers localgroup
net localgroup sshusers /add
net localgroup sshusers sshd administrator /add

REM Grant sshusers and sshd rights to the appropriate folder structure
cacls d:\ /e /g sshusers:r
cacls d:\apps /e /g sshusers:r
cacls d:\apps\unix /e /g sshd:c sshusers:r /t
cacls d:\users /e /g sshdusers:r 
cacls d:\users\* /e /g sshd:r

REM Install the sshd service
instsrv sshd remove
instsrv sshd d:\apps\unix\usr\local\sbin\srvany.exe
regedit /s sshd.reg
sc config sshd start= auto obj= %COMPUTERNAME%\sshd password= password

REM Clean up the root folder
del .\*.* /q
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sshd.reg
Type: text/x-ms-regedit
Size: 148 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/19981216/c17d8fd7/attachment-0001.bin>


More information about the Cygwin mailing list