[debian-lan-devel] quick ssh to workstation

Julien Lambot jlambot at gmail.com
Mon Apr 22 22:58:29 UTC 2013


Hi Andi,

Testing the project I thought the following could be of use (I hope it's
the right way of doing things)

/srv/fai/config/scripts/SERVER_A/45-ssh-argv0
----
#!/bin/bash
#
# Prepare quick ssh link to all workstations
# ref:
http://www.nrtm.org/index.php/2009/06/09/ssh-argv0-for-the-lazzy-ssh-typer/
#

set -e

# I considered this was better in a subdir but then, $PATH is not included.
I'll check this out
#if [ ! -d /usr/local/bin/ssh ]; then
#    mkdir /usr/local/bin/ssh
#else
#   echo "directory already exists"
#fi

# this seems to be a global variable but I included it for test purposes.
WS_RANGE="50 149"

    NUM=0
    for i in `seq $WS_RANGE` ; do
        NUMSTR=`printf "%02d" $NUM`
        ln -s /usr/bin/ssh-argv0 /usr/local/bin/workstation$NUMSTR
        NUM=$(($NUM+1))
    done
----
With this you can ssh a workstation just by typing its hostname.

Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/debian-lan-devel/attachments/20130423/dbf1ad8b/attachment.html>


More information about the debian-lan-devel mailing list