Home   Notes   Contact Me

Cygwin


path conversion from cygwin to windows and windows to cygwin

# windows to cygwin: cygpath "c:\\Delme\\" # shows: /cygdrive/c/Delme/ # cygwin to windows cygpath -d /cygdrive/c/Delme/ # shows: c:\Delme\

Logout, but make command continue

Try this (unverivfied)

ssh -N -f -L 2110:mailhost.com:110 dmurdoch@mailhost.com >/dev/null 2>/dev/null </dev/null &

It may have something to do with malicious code hijack stdin, stdout, and/or stderr
It may be cygwins way of preventing it from happening


passwd, Refreshing /etc/passwd and /etc/groups

// If computer is not part of a Domain mkpasswd -l > /etc/passwd mkgroup -l > /etc/group // If computer is part of a domain mkpasswd -d > /etc/passwd mkgroup -d > /etc/group // Do you every do this? mkpasswd -l -d > /etc/passwd mkgroup -l -d > /etc/group

Install info

  1. The last time I did this sucessfully (under Windows XP Professional), was logged in as Admininstrator
  2. [???] Make sure system install is on Start | My Computer | right click | properties | System Restore
  3. [This seems to be critical for sshd privledge seperation] Make sure simple file sharing is off Explorer | Tools | Folder Options | View | (at the bottom) Use Simple File Shareing (Recommended)
  4. Download cygwin installer (get it from: http://www.cygwin.com) into C:\Install\cygwin
  5. Run it
  6. Select Install For | All Users
  7. Place local package directory in save place as installer (C:\Install\cygwin)
  8. Make sure the Things to install (shown below), will all be installed
  9. Next Setup sshd

Things to install

  1. Editors | vim
  2. Net | openssh
  3. Net | openssl
  4. Net | wget
  5. binuils (it contains strings command)

sshd, setting it up

  1. [This seems to be critical for sshd privledge seperation] Make sure simple file sharing is off Explorer | Tools | Folder Options | View | (at the bottom) Use Simple File Shareing (Recommended)
  2. Start a cygwin shell
  3. Run ssh-host-config -y
  4. answer the terminal question with ntsec tty
  5. Start the service with cygrunsrv -S sshd
  6. When starting the service fails, you are hosed, and will just have to run sshd manually, or better yet, add a cron job to start it if it is not running.
http://tech.erdelynet.com/cygwin-sshd.html

Here is a sort of useful link to determine what rights need to be granted to allow ssh logins to other accounts
http://www.cygwin.com/ml/cygwin/2003-07/msg00684.html Basically the following need to be allowed on the account that the service is running on (but it sounds like that is not how it is supposed to be). Here is a link to Microsoft info on adding a token
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/windowsserver2003/proddocs/entserver/531.asp


ssh, installing

In the cygwin installer, add the following packages

Explorer Right Click to cygwin, adding cygwin to the menu