{"id":132,"date":"2008-03-03T15:42:51","date_gmt":"2008-03-03T19:42:51","guid":{"rendered":"http:\/\/www.andrewlouie.com\/wordpress\/how-to\/setting-up-cygwin-with-sshcron-syslog-ng\/"},"modified":"2008-03-03T16:23:26","modified_gmt":"2008-03-03T20:23:26","slug":"setting-up-cygwin-with-sshcron-syslog-ng","status":"publish","type":"page","link":"https:\/\/www.andrewlouie.com\/wordpress\/how-to\/setting-up-cygwin-with-sshcron-syslog-ng\/","title":{"rendered":"Setting Up Cygwin with SSH,CRON, syslog-ng"},"content":{"rendered":"<p>The aim of this Page is to set up Cygwin and configure an SSH server and syslog-ng logging:<\/p>\n<p>I am assuming you already know how to install cygwin, and select packages to install.<\/p>\n<p>Here we go:<\/p>\n<h2>Cygwin<\/h2>\n<ol>\n<li> Install Cygwin from <a href=\"http:\/\/cygwin.com\/\" title=\"cygwin\">cygwin.com<\/a><\/li>\n<li>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&#8217;t want to do that, then simply generate a list of local groups and only add yourself to the passwd file:<\/li>\n<pre>$mkgroup -d &gt; \/etc\/group<\/pre>\n<pre>$mkpasswd -lc &gt;\/etc\/passwd<\/pre>\n<li>I like to use rxvt, so I made this following change to the cygwin.bat file found in your base cygwin directory:\n<pre>\t\trxvt - e -bash --login -i<\/pre>\n<\/li>\n<li>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 <a href=\"http:\/\/www.cygwin.com\/ml\/cygwin\/2007-09\/msg00373.html\">message.<\/a> what you could do is set the font in your ~\/.Xdefaults file like mine:<a href=\"https:\/\/www.andrewlouie.com\/wordpress\/wp-content\/uploads\/2008\/03\/.Xdefaults\" title=\"Xdefaults  file for rxvt\"> Xdefaults  file for rxvt<\/a><\/li>\n<li>while we are on the subject of making things look good, how about some color: add the line:\n<pre>\t\talias ls=\"ls --color=auto\"<\/pre>\n<p>to your ~\/.bashrc file<\/li>\n<li>and to configure the colors,  copy over the .DIR_COLORS file from \/etc\/.DIR_COLORS and edit that as you please<\/li>\n<li>Now time to set up SSH<\/li>\n<\/ol>\n<h2>SSH<\/h2>\n<ol>\n<li>first, configure the host, run:\n<pre>\t\tssh-host-config<\/pre>\n<p>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<\/li>\n<li> Then simply follow the instructions and attempt to start the sshd service\n<pre>\t\tcygrunsrv -S sshd<\/pre>\n<p>If all went well you should get no errors.<\/li>\n<li>test out the installation by trying to login:\n<pre>\t\tssh hostname<\/pre>\n<p>If you get a setgid:Invalid Argument error, you messed up something in your \/etc\/group or \/etc\/mkpasswd file. regenerate both files.<\/li>\n<li>If everything worked, Congrats now on to cron<\/li>\n<\/ol>\n<h2>CRON<\/h2>\n<ol>\n<li>run cron-config and answer the prompts, fairly straight forward.<\/li>\n<li>use crontab -e to configure jobs.<\/li>\n<li>if cron seems to be randomly quitting, it maybe becuase it&#8217;s trying to mail you the log of its activites, and you don&#8217;t have mail setup. so simply add &#8220;MAILTO=&#8221;&#8221; to the crontab.<\/li>\n<\/ol>\n<h2>Syslog-ng<\/h2>\n<ol>\n<li>run syslog-ng-config<\/li>\n<li>Man they sure did make things easy.<\/li>\n<\/ol>\n<p>Well that&#8217;s it, I&#8217;ll add some more stuff as I come across them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 Install Cygwin from cygwin.com Upon first running cygwin you may be presnted with some kind of message telling [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":131,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-132","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.andrewlouie.com\/wordpress\/wp-json\/wp\/v2\/pages\/132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.andrewlouie.com\/wordpress\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.andrewlouie.com\/wordpress\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.andrewlouie.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.andrewlouie.com\/wordpress\/wp-json\/wp\/v2\/comments?post=132"}],"version-history":[{"count":0,"href":"https:\/\/www.andrewlouie.com\/wordpress\/wp-json\/wp\/v2\/pages\/132\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.andrewlouie.com\/wordpress\/wp-json\/wp\/v2\/pages\/131"}],"wp:attachment":[{"href":"https:\/\/www.andrewlouie.com\/wordpress\/wp-json\/wp\/v2\/media?parent=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}