Andrew Louie Freedom isn’t Free, it costs folks like you and me

March 3, 2008

Setting Up Cygwin with SSH,CRON, syslog-ng

Filed under: — andrew @ 3:42 pm

The aim of this Page is to set up Cygwin and configure an SSH server and syslog-ng logging:

I am assuming you already know how to install cygwin, and select packages to install.

Here we go:

Cygwin

  1. Install Cygwin from cygwin.com
  2. Upon first running cygwin you may be presnted with some kind of message telling you that you need to regenerate the /etc/passed and /etc/group files. Simply follow the instructions on screen, it should take about 2 seconds, on the other hand if you are on a corporate network with thousands of users and thousands of groups, it could take along time, and if you don’t want to do that, then simply generate a list of local groups and only add yourself to the passwd file:
  3. $mkgroup -d > /etc/group
    $mkpasswd -lc >/etc/passwd
  4. I like to use rxvt, so I made this following change to the cygwin.bat file found in your base cygwin directory:
    		rxvt - e -bash --login -i
  5. Now I need some configuration files to make rxvt look good. If rxvt looks really ugly it is probably becuase you are missing fonts, see this message. what you could do is set the font in your ~/.Xdefaults file like mine: Xdefaults file for rxvt
  6. while we are on the subject of making things look good, how about some color: add the line:
    		alias ls="ls --color=auto"

    to your ~/.bashrc file

  7. and to configure the colors, copy over the .DIR_COLORS file from /etc/.DIR_COLORS and edit that as you please
  8. Now time to set up SSH

SSH

  1. first, configure the host, run:
    		ssh-host-config

    answer yes to privilege separation, yes to create local sshd account, and yes to install as a service, and use ntsec for the CYGWIN= prompt

  2. Then simply follow the instructions and attempt to start the sshd service
    		cygrunsrv -S sshd

    If all went well you should get no errors.

  3. test out the installation by trying to login:
    		ssh hostname

    If you get a setgid:Invalid Argument error, you messed up something in your /etc/group or /etc/mkpasswd file. regenerate both files.

  4. If everything worked, Congrats now on to cron

CRON

  1. run cron-config and answer the prompts, fairly straight forward.
  2. use crontab -e to configure jobs.
  3. if cron seems to be randomly quitting, it maybe becuase it’s trying to mail you the log of its activites, and you don’t have mail setup. so simply add “MAILTO=”” to the crontab.

Syslog-ng

  1. run syslog-ng-config
  2. Man they sure did make things easy.

Well that’s it, I’ll add some more stuff as I come across them.

No Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

Powered by WordPress