Operating System - HP-UX
1759165 Members
3016 Online
108879 Solutions
New Discussion юеВ

Re: Open New Session from Workstation.

 
baiju_3
Esteemed Contributor

Open New Session from Workstation.

Dear All,

Suppose I have 10 servers , and I need to open a ssh window automatically to all these 10 servers from my workstation , how can I do it .

Is there any script or program available for that .

My requirement is to execute the script and it should pop up 10 different windows asking for user name and passwords to those servers .
So that I will provide username and password and keep these sessions opened , so that in case my root file system gets locked I can at least have a open session from my workstation .

How is this possible ,any help .

Thanks in advance ,
bl.








Good things Just Got better (Plz,not stolen from advertisement -:) )
3 REPLIES 3
Jeff_Traigle
Honored Contributor

Re: Open New Session from Workstation.

Assuming it's the same username for all servers, you should be able to do something like this to accomplish what you want.

#!/usr/bin/sh

# serverlist is a file with a list
# of servers, one per line

SERVERS=$(cat serverlist)

# Can give username as a command line
# argument to this script

USER=$1

# Open the windows to make the ssh
# connections

for SERVER in ${SERVERS}
do
hpterm -e "ssh ${USER}@${SERVER}" &
done
--
Jeff Traigle
Rick Garland
Honored Contributor

Re: Open New Session from Workstation.

You could have a 10 line executable that is calling the ssh to those servers.

Example;
dtterm -e &
(repeat this line for each server)

To make more elaborate with colors and scroll bars and fonts, etc.
dtterm -bg azure -fg black -sb -sl 1000 -font 8x16 -name -title -e ssh &

Using the dtterm executable - you may want/need to use the xterm (depending on flavor)

Just put these into a file and make executable.

baiju_3
Esteemed Contributor

Re: Open New Session from Workstation.

Thanks .
Good things Just Got better (Plz,not stolen from advertisement -:) )