Wireless Hacks Free Open Book

Wireless Hacks

Previous Section Next Section

Hack 96 OpenSSH on Windows Using Cygwin

figs/beginner.giffigs/hack96.gif

Use any of the powerful OpenSSH hacks in this chapter on a Windows box.

So you've read all the nifty cool hacks so far using OpenSSH, but you're a Windows guy or gal who hasn't (yet) taken the plunge into the world of Linux. That's okay! You can still take advantage of the power of OpenSSH on your Windows box by using a tool called Cygwin.

As the Cygwin web site explains:

Cygwin is a Linux-like environment for Windows. It consists of two parts:

A DLL (cygwin1.dll) which acts as a Linux emulation layer providing substantial Linux API functionality.

A collection of tools, which provide Linux look and feel.

This powerful and free package allows you to run many free software packages in Linux, all without leaving the safety and comfort of your Windows environment.

Installation

The software can be downloaded from http://www.cygwin.com/. To install Cygwin, run setup.exe and then select the Linux tools you want to install. These will be downloaded from the Internet and installed automatically. Using setup.exe, you can also choose to download only the install files, or to install them from a local directory. For the purposes of this hack, I assume that you are installing directly from the Internet.

In the first dialog box, choose an installation directory, installation type, and default text file type. Unless you need to change any of these options, just stick with the defaults for now. In the second dialog box, choose a directory where the software packages will be downloaded. This is useful to remember if you're going to be doing multiple installs. Third, you need to choose an Internet connection type. If you're inside a corporate network, you may need to consult with someone on these settings. Generally a direct connection works if you are a home user.

Lastly, you need to choose a download site. There are a whole range of sites listed, located all around the world. Choose the site that is roughly closest to your country.

setup.exe will then download the next portion of the setup program, and you will be prompted to Select Packages, as shown in Figure 7-9.

Figure 7-9. Cygwin Install Packages screen.
figs/wh_0709.gif

There are a large number of software packages that Cygwin can install for you. To add OpenSSH as an installed software package, navigate to the Net category. Click on the plus sign next to Net and scroll down until you find the line that lists OpenSSH, as shown in Figure 7-10.

Figure 7-10. Locate openssh.
figs/wh_0710.gif

Click once on the word "Skip" on the line that shows openssh. You will see the change shown in Figure 7-11.

Figure 7-11. Select openssh.
figs/wh_0711.gif

Note that when you selected openssh, openssl is also automatically selected. This is because openssh relies on the encryption routines contained in openssl.

One more package you will need to install, particularly if you want the sshd daemon to run as a service in Windows 2000 or Windows XP, is cygrunsrv. This package can be found in the Admin category, as shown in Figure 7-12.

Figure 7-12. Select cygrunsrv
figs/wh_0712.gif

Click Next, and Cygwin will begin downloading and installing the selected packages. Once installation is done, you'll have Cygwin icons on your desktop and in the Start menu.

To get things properly set up, you need to change a few things in your System Environment. In Windows 2000 and Windows XP, right-click on My Computer and choose Properties. Click on the Advanced tab and then select Environment Variables. Find the variable for Path and double-click on it. At the end of the path, add a semicolon and the full path to the installed Cygwin (C:\cygwin\bin by default, unless you changed it when you installed it). Also add a new variable by clicking on New. The variable name is CYGWIN. The variable value should be ntsec tty.

OpenSSH Configuration

To get the openssh daemon running, open up a Cygwin bash shell and run this:

Administrator@notebook ~$ ssh-host-config -y

This generates ssh keys and an sshd config file for your system, and sets up sshd to run as a Windows service. You'll be prompted for a value of CYGWIN for sshd at startup. Enter the same string that you used for the CYGWIN environment variable: ntsec tty.

Now you can start up sshd as a service by running this command:

Administrator@notebook ~$ cygrunsrv -S sshd 

You can test your sshd installation by typing ssh localhost. If all goes well, you should be able to log in to your own machine.

You should now be able to copy files with scp, set up key dependencies, and use all of the other time saving SSH tips and tricks mentioned elsewhere in this chapter. For example, you can secure your email by using port forwarding [Hack #93]. With sshd up and running, you can even connect to your Windows machine from other computers running ssh. Cygwin might not be quite as powerful as a complete Linux installation, but it allows you to use many important free software packages without even having to reboot.

    Previous Section Next Section
    Index: [SYMBOL][A][B][C][D][E][F][G][H][I][J][L][M][N][O][P][Q][R][S][T][U][V][W][X][Z]


         Main Menu
    Main Page
    Table of content
    Copyright
    Credits
    Foreword
    Preface
    Chapter 1. The Standards
    Chapter 2. Bluetooth and Mobile Data
    Chapter 3. Network Monitoring
    Chapter 4. Hardware Hacks
    Chapter 5. Do-It-Yourself Antennas
    Chapter 6. Long Distance Links
    Chapter 7. Wireless Security
    7.1 Hacks #86-100
    Hack 86 Making the Best of WEP
    Hack 87 Dispel the Myth of Wireless Security
    Hack 88 Cracking WEP with AirSnort: The Easy Way
    Hack 89 NoCatAuth Captive Portal
    Hack 90 NoCatSplash and Cheshire
    Hack 91 Squid Proxy over SSH
    Hack 92 SSH SOCKS 4 Proxy
    Hack 93 Forwarding Ports over SSH
    Hack 94 Quick Logins with SSH Client Keys
    Hack 95 'Turbo-Mode' SSH Logins
    Hack 96 OpenSSH on Windows Using Cygwin
    Hack 97 Location Support for Tunnels in OS X
    Hack 98 Using vtun over SSH
    Hack 99 Automatic vtund.conf Generator
    Hack 100 Tracking Wireless Users with arpwatch
    Appendix A. Deep Dish Parabolic Reflector Template
    Colophon
    Index


    More Books
    PHP Hacks
    Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax
    The Koran (Holy Qur'an)
    Macromedia Flash 8 Bible
    Search Engine Optimization for Dummies
    YouTube Traffic
    PHP 5 for Dummies
    Harry Potter and The Chamber of Secrets
    Harry Potter and the Sorcerer's Stone
    The Pilgrim's Progress
    Wireless Hacks
    Flash Hacks. 100 Industrial-Strength Tips & Tools
    PayPal Hacks. 100 Industrial-Strength Tips and Tools
    Amazon Hacks
    Pdf Hacks
    The Da Vinci Code
    Google Hacks
    The Holy Bible
    Windows XP For Dummies
    Harry Potter and the Half-Blood Prince
    Seo Book
    Upgrading and Repairing Networks
    Macromedia Dreamweaver 8 UNLEASHED
    Windows XP Annoyances
    Windows XP Hacks
    Microsoft Windows XP Power Toolkit
    Teach Yourself MS Office In 24Hours
    iPod & iTunes Missing Manual
    PC Hacks 100 Industrial-Strength Tips and Tools
    PC Overclocking, Optimization, and Tuning - 2th Edition
    PC Hardware In A Nutshell 3rd Edition
    PC Hardware in a Nutshell, 2nd Edition
    Upgrading and Repairing PCs
    Google for Dummies
    MySQL Cookbook
    Teach Yourself Macromedia Flash 8 In 24 Hours
    PHP CookBook
    Sams Teach Yourself JavaScript in 24 Hours
    PHP5 Manual
    Free Games Paper Airplanes
    500 Juegos Gratis 500 Giochi Gratis 500 Jeux Gratuits 500 Jogos Gratis 500 Kostenlose Spiele