Sponsored Content
Top Forums Shell Programming and Scripting shell script to run after ssh logout from another machine Post 302534890 by defamer on Wednesday 29th of June 2011 05:56:38 AM
Old 06-29-2011
Network shell script to run after ssh logout from another machine

Scenario:
I currently manager a cluster at work which is on a private network and i constantly need to ssh to other clients for diags e.t.c. I created a debain client which i use as my gateway to get to all the clients on the private network and I then created a Shell menu script which will make it easier for me to access all the clients, get diags...e.t.c

I have managed to get the script to work (by putting it in the .bashrc) to run every time the "test" user logs in which is good. I use this machine to ssh to other machines too...

so my problem:
Is it possible to have this script run when i exit a ssh session from another client back into this debian machine? i.e

client a = my machine
client b = gateway machine to private network with menu script
client c,d,e = private network clients

client a will ssh to client b (as test) - menu loads. I select option 1 to ssh to client c, do some stuff and exit client c back to client b. This currently gets me to a bash prompt - I want this to load the menu again so i can easily do other things rather than manually loading the menu again. (hope that makes sense)

is that possible?

Last edited by defamer; 06-29-2011 at 10:49 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to run a command in different machine using SSH

how to run a command in different machie in my case script will runs in solaries machine.. in one instance it has to run a command in different machine with different operating system ( linux ) using SSH command i tried ssh -l (login_name) (machine name/host ) " command " but it is... (3 Replies)
Discussion started by: mail2sant
3 Replies

2. UNIX for Dummies Questions & Answers

run a script at logout

hi all , Need to a run a program on user logout (using GNOME log screen). Tried using .bash_logout for this purpose but that doesnt seem to work. Similar to .bash_logout is there any script /program which a normal user (other than root ) can edit and run it on their logout? can anybody... (0 Replies)
Discussion started by: harsha10
0 Replies

3. Shell Programming and Scripting

Run shell script on another server using ssh

Hi, I have 2 servers and i installed ssh2 on both boxes .. so they they can communicate with each other with our password auth .. now i want to write a scrip on box 1 for running commands and getting out put from the second box can some one help me out Thank you in advance (1 Reply)
Discussion started by: anwesh
1 Replies

4. Shell Programming and Scripting

How to run script on logout ?

Hi Everybody, I want to run my own script on logout , i can use .bash_logout file... problem is this will work only for that particular user... i want to know the common file... so that script wil run for all the user... 2. How to run script on Shutdown ? Thanks in advance Anitha (4 Replies)
Discussion started by: anisn2002
4 Replies

5. Shell Programming and Scripting

executing command in a remote machine through ssh - shell script

Hi All, i have two machines like x and y . my requirement is i should connect to machine Y from x through ssh connection . and do some operation such as copy and move and delete files in Y machine . i tried with this code but it is doing in machine x only . and i need to exit from Y when... (1 Reply)
Discussion started by: rateeshkumar
1 Replies

6. Shell Programming and Scripting

ssh - run shell script - Error

Hi Team, I am trying to run shell script from one server to another server with below command. ssh abc@pqr.america.com /tmp/test.ksh But, it gives below error. Can someone help me what is the issue? exec(): 0509-036 Cannot load program ssh because of the following errors: ... (3 Replies)
Discussion started by: ace_friends22
3 Replies

7. Shell Programming and Scripting

run query in shell script after ssh

Hi, I need to run sql query in shell script after getting connected to ssh. For that I connected to ssh through shell script using RSA keys done]. Now when I am running sql query, it's not working... but several other commands like 'ls'. 'mkdir', etc are working properly. Here is my code: ... (2 Replies)
Discussion started by: shekhar2010us
2 Replies

8. UNIX for Dummies Questions & Answers

how to use ssh to run shell script on a remote machine?

how to use ssh to run shell script on a remote machine? ssh user@remote sh ./script.unx i ran the above command ./script.unx HAS NOHUP COMMAND IN ITS BODY, I AM GETTING ERROR AS NOHUP NOT FOUND... i tried to run that script from remote server, its working fine do ineed to set... (6 Replies)
Discussion started by: only4satish
6 Replies

9. Shell Programming and Scripting

Run shell script on different machine using perl script

I want to execute my shell script on remote machine using SSH in perl script. Please help me with syntax. (2 Replies)
Discussion started by: james1988
2 Replies

10. Shell Programming and Scripting

To run a local shell script in a remote machine by passing arguments to the local shell script

I need to run a local shell script on a remote machine. I am able to achieve that by executing the command > ssh -qtt user@host < test.sh However, when I try to pass arguments to test.sh it fails. Any pointers would be appreciated. (7 Replies)
Discussion started by: Sree10
7 Replies
ris(8)							      System Manager's Manual							    ris(8)

Name
       ris - remote installation services utility

Syntax
       /etc/ris

Description
       The  utility performs remote installation services which install system software to a client machine through the TCP/IP local network.  The
       client machine can be a VAX or a RISC machine.

       The server on which the remote installation services area is located can be either a VAX or a RISC machine.

       The remote installation services utility uses the directory as a base.  When you install the first product to the utility creates a  remote
       installation services area.  The area is called either or

       The  area contains one or more ULTRIX software products.  Each product contains the subsets of the kits that can be installed to clients on
       a network.  Clients registered for an area install software over the network to their processor.

       The utility performs the following functions:

       a -  Add client

       r -  Remove client

       s -  Show products in remote installation environments

       m -  Modify client

       i -  Install software

       You must use the utility interactively to set up a remote installation services area.  After you have set up a remote installation services
       area on the server, you can use the utility either interactively or from the command line to manage clients.

       The directory also holds a subdirectory, This directory contains a database file, that you can use to manage multiple clients.

Examples
       The example that follows invokes the utility interactively:
       # /etc/ris

       A menu appears from which you can select options to perform functions.

       The examples that follow manage the client using the command line.

       The syntax of the command to add a client follows:
       /etc/ris -a <clientname> -h <Ethernet_address> -p path,product[,product]

       The following command adds client and allows that client to install a product over the network:
       # /etc/ris -a bergal -h 08-00-2B-03-05-8B -p ris0.mips,product_1

       The syntax of the command to modify a client follows:
       /etc/ris -a <clientname> [-h <Ethernet_address>] [-p <path,product,product>]

       The following command modifies client and allows that client to install a product over the network:
       # /etc/ris -m bergal -p ris0.mips,product_2

       The syntax of the command to remove a client follows:
       /etc/ris -r <clientname>

       The following command removes client
       # /etc/ris -r bergal

Files
See Also
       setld(8)
       Guide to the Remote Installation Services
       Guide to Server Setup

																	    ris(8)
All times are GMT -4. The time now is 10:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy