Wireless Hacks Free Open Book

Wireless Hacks

Previous Section Next Section

Hack 95 "Turbo-Mode" SSH Logins

figs/moderate.giffigs/hack95.gif

Even faster logins from the command line.

If you've just come from the previous two hacks, you've only seen half of the solution! Even with client keys, you still have to needlessly type SSH server every time you want to SSH in. Back in the dark, insecure, unenlightened days of rsh, there was an obscure feature that I happened to love, which hasn't (yet) been ported to SSH. It used to be possible to symlink /usr/bin/rsh to a file of the same name as your server. rsh was smart enough to realize that if it wasn't called as rsh, that it should rsh to whatever name it was called as.

Of course, this is trivial to implement in shell. Create a file called SSH-to with these two lines in it:

 #!/bin/sh
 ssh `basename $0` $*

(Those are backticks around basename $0.) Now put that in your PATH (if ~/bin doesn't exist or isn't in your PATH already, it should be) and set up symlinks to all of your favorite servers to it:

 $ cd bin
 $ ln -s ssh-to server1
 $ ln -s ssh-to server2
 $ ln -s ssh-to server3

Now, to SSH to server1 (assuming you've copied your public key over as just described), simply type server1 and you'll magically end up with a shell on server1, without typing ssh, and without entering your password. That $* at the end allows you to run arbitrary commands in a single line (instead of spawning a shell), like this:

 server1 uptime

This will simply show the uptime, number of users, and load average on server1, then exit. Wrap it in a for loop and iterate over a list of servers to get a pinpoint status of all of your machines.

I believe that this is the quickest way to use SSH, short of setting up single character aliases to do it for you (which is excessively hackish, unmaintainable, and unnecessary, although it does seem to impress some people):

 $ alias a='ssh alice'
 $ alias b='ssh bob'
 $ alias e='ssh eve'
 ...

At any rate, SSH has many options that make it a very flexible tool for securely navigating between any number of servers. Now if we can just find a way to make it log in and actually fix the machine for you, we'd have a real hack.

    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