Sponsored Content
Special Forums IP Networking Execute script located on a remote machine Post 302667289 by spynappels on Friday 6th of July 2012 04:20:11 AM
Old 07-06-2012
When you connect using PuTTY, are you just putting the details in and connecting, or are you using some saved session?

It could be that the saved session has the hop saved in as a command to execute on login to serverA. If it is a saved session, load it but don't initiate the connection, and go to the SSH Tab/Category. There is an entry there where you can specify a remote command such as that required to ssh from ServerA to ServerB, so you automatically get forwarded from ServerA to ServerB when you login to ServerA using the saved PuTTY profile.

I think you can direct Plink to use the same profiles, but I'm not 100% certain of that. You could look at the PuTTY documentation to see the details. PuTTY User Manual

If this is the case, we just need to figure out how to get the script from the Windows box to ServerB, this could probably be done using 2 separate scp commands within a single script.

---------- Post updated at 09:20 AM ---------- Previous update was at 08:50 AM ----------

Quote:
Originally Posted by spynappels
I think you can direct Plink to use the same profiles, but I'm not 100% certain of that. You could look at the PuTTY documentation to see the details. PuTTY User Manual
I just tested this and if you have a saved session in PuTTY, you can use the same session in plink
Code:
plink -load <<session-name>>

If the session name has a space in it, you can put it into double quotes.

I also checked if a saved session has a "ssh user@anotherhost" command saved in the SSH category, it will lok like it directly logs into anotherhost without an internediate shell, and you should just be asked for the password for 'server' first, and then for 'anotherserver'. The good news is this works exactly the same if this session is then used for a plink connection.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to execute a script on remote machine

hi unix guru's i am new to unix shell programming. i found a trouble in executing a script(bali.ksh) which is available on serverA with username xyza, this script contains sqlplus command to retrive the data from the database available on other serverC. Now i need to run the above script... (4 Replies)
Discussion started by: balireddy_77
4 Replies

2. Shell Programming and Scripting

Execute command from terminal on remote machine

Hi All, I want to execute some commands on unix machine from the mac machne. I have two options for doing so, I am confused which is the best way of doing. Here are two options. Requirement: Execute command on the remote server machine. Commands to be executed itself contain arguments to be... (0 Replies)
Discussion started by: Ranu
0 Replies

3. Shell Programming and Scripting

How to execute a script hosted on a machine from a different machine

Hi everyone I intend to trigger a script from one machine say mc1 that actually excutes on different machine say mc2 and redirect the logs to that machine mc2. I tried to use nohup <nfs location of machine >/script.sh > <nfs location of machine >/script.log 2>&1 & nfs location of... (2 Replies)
Discussion started by: harneetmakol
2 Replies

4. Shell Programming and Scripting

Change user on remote machine and execute script!

Hi, I need to login into remote server and execute a shell script over there. As of now i am making use of ssh command ssh primUser@135.254.242.2 sh /poll.sh I am logging in as primUser but unless i change the user to root the script execution on the remote machine is not possible. ... (5 Replies)
Discussion started by: goutham4u
5 Replies

5. Shell Programming and Scripting

unix shell script which inserts some records into a file located in remote servers...

All, I need to write an unix shell script which inserts some records into a file located in remote servers. * Get the input from the user and insert according the first row. It should be in ascending order. 123451,XA,ABA 123452,XB,ABB 123453,XC,ABC 123455,XE,ABE 123456,XF,ABF 123458,XG,ABG... (2 Replies)
Discussion started by: techychap
2 Replies

6. Shell Programming and Scripting

To execute the same script in another machine

We have a few machines which share the same directory. How can I execute the same script under that directory in different machine while I am using mine? (1 Reply)
Discussion started by: jiao
1 Replies

7. Shell Programming and Scripting

How to execute the same script on another machine

Recently, I need to generate a lot of files from a few master files. In fact, if I relogin to the server machine, my operating would be much faster. My question is this: Can I write a script in which the current path can be automatically saved and relogin to the server to execute my command in the... (0 Replies)
Discussion started by: jiao
0 Replies

8. UNIX for Dummies Questions & Answers

Execute shell script in remote machine

Hi All, We have 2 servers A and B. B is having a sctipt called b.sh in path /home/dev/scripts. Now my requirement is i want to execute b.sh from server A. Kindly help me. (3 Replies)
Discussion started by: Girish19
3 Replies

9. Shell Programming and Scripting

Execute shell script on remote machine

I want to execute a shell script(set of commands) on remote machine and that script takes input from text file(local machine). Please refer below: ssh user@hostname 'bash -s'< ./test.sh file.txt But i got the error file.txt doesn't exist. Can anyone help me on this. Content of test.sh: ... (2 Replies)
Discussion started by: manishtri88
2 Replies

10. Shell Programming and Scripting

How can I execute local script on remote machine and include arguments?

I have a script in local server cd /home/dell/work/BOP/testdir ./processchk po (here processchk is a script & po is passed as an argument) Now I want to execute this script from remote server ssh $username@$hostname "cd /home/dell/work/BOP/testdir; ./processchk po" But Its getting error... (9 Replies)
Discussion started by: manohar2013
9 Replies
GNOME-SESSION(1)					      General Commands Manual						  GNOME-SESSION(1)

NAME
gnome-session - Starts up the GNOME desktop environment SYNOPSIS
gnome-session [--autostart=DIR] [--default-session-key=KEY] [--failsafe|-f] [--debug] DESCRIPTION
The gnome-session program starts up the GNOME desktop environment. This command is typically executed by your login manager (either gdm, xdm, or from your X startup scripts). It will load either your saved session, or it will provide a default session for the user as defined by the system administrator (or the default GNOME installation on your system). The default session is defined in the GConf keys under /desktop/gnome/session. When saving a session, gnome-session saves the currently running applications in the $XDG_CONFIG_HOME/gnome-session/saved-session directory. gnome-session is an X11R6 session manager. It can manage GNOME applications as well as any X11R6 SM compliant. OPTIONS
The following options are supported: --autostart=DIR Start all applications defined in DIR, instead of starting the applications defined in /desktop/gnome/session/default_session, or via the --default-session-key option. Multiple --autostart options can be passed. --default-session-key=KEY Sets the GConf key from which applications running a default session should be read to KEY. If not specificed, /desktop/gnome/ses- sion/default_session will be used. --failsafe gnome-session will run in fail-safe mode. User-specified applications will not be started. --debug Enable debugging code. ENVIRONMENT
gnome-session accepts all of the standard environment variables used by gnome programs, other than the SESSION_MANAGER environment vari- able. gnome-session also sets several environment variables for the use of its child processes. SESSION_MANAGER This variable is used by session-manager aware clients to contact gnome-session. DISPLAY This variable is set to the X display being used by gnome-session. Note that if the --display option is used this might be different from the setting of the environment variable when gnome-session is invoked. SEE ALSO
gnome-session-properties(1) gnome-session-save(1) gnome-wm(1) BUGS
If you find bugs in the gnome-session program, please report these on http://bugzilla.gnome.org. GNOME GNOME-SESSION(1)
All times are GMT -4. The time now is 03:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy