Menu driven SSH

From http://blog.amit-agarwal.co.in

I have quite a lot of servers where I need to ssh at workplace and I generally don’t remember all of them, so I wrote a simple yet useful script. In all the servers I have already copied my key so I dont need a password to login. Without much ado, here is the script.

echo “Enter the server name:”
echo “1. redhat”
echo “2. fedora”

read server

if [ “$server” = “1” ]; then
ssh amit@redhat
else if [ “$server” = “2” ]; then
ssh amit@fedora
else
echo “Not a valid choice”
fi
fi

You can download the script ssh_menu here.

g33kadmin

I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.