LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Shortcut / Launcher for Auto SSH Console Window (http://www.linuxquestions.org/questions/linux-general-1/shortcut-launcher-for-auto-ssh-console-window-658847/)

eyeprotocol 07-28-2008 02:57 PM

Shortcut / Launcher for Auto SSH Console Window
 
Hello all

I run Gnome, and wish to create a shortcut/launcher on my desktop that (once double-clicked) will open a console window and auto run ssh (with proper parameters) so that it will attempt to login to a remote server.
Is this possible?

Please assist.

MasterC 07-28-2008 03:09 PM

Sure, here's a script I use for just such an occasion:
Code:

#!/bin/bash

# Clear the screen
clear

# Launch an XFCE4 Terminal with all the linux servers in tabs
# this is a work in progress...

# Define Servers
echo "Defining servers for $HOSTNAME.mydomain.edu"
echo
www="www.mydomain.edu"
other="other.mydomain.edu"

# Short or preferred names

www1="Web_Server"
other1="Other_Server"


# Launch the Terminal

echo "Launching the terminals now"
echo

source ~/.bash_profile
Terminal --title $www1 --command "ssh -l username $www" \
--tab --title $other1 --command "ssh -l username $other"

echo "All set"
echo

Could certainly use a little "cleaning" but it seems to work for my needs.

{edit}
Forgot to mention keys. You could also setup keys to exchange to bypass a required password and just the SSH keyphrase instead. It feels a little more secure than just sending my password to each server.
{edit}

-Chad

eyeprotocol 07-28-2008 03:19 PM

Thank you Chad.

My keys are all setup properly, thank you.

However, the script is not working. It has an empty "echo" line and it has a line starting with "Terminal". My machine reports that this command does not exist. Am i missing something?

:)

eyeprotocol 07-28-2008 03:26 PM

Ahhh.. forget it. It needs the command "gnome-terminal" instead.

Sincere thanks.

:)


All times are GMT -5. The time now is 10:20 AM.