Unix/Linux Go Back    


Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

Method to run a shell script using shortcut key in keyboard with out logging to putty

Windows & DOS: Issues & Discussions


Tags
solved, unix and windows applications, user access

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 07-31-2015
Chi_SL Chi_SL is offline
Registered User
 
Join Date: Jul 2015
Last Activity: 7 August 2015, 1:49 AM EDT
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Method to run a shell script using shortcut key in keyboard with out logging to putty

Dear All,

I want to run a shell script with out logging to putty but configuring it to a keyboard short cut it windows PC. Can this be done? I want this to rename a log in a specified folder in a system

Thanks
Sponsored Links
    #2  
Old Unix and Linux 07-31-2015
RudiC RudiC is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 27 July 2017, 4:41 PM EDT
Location: Aachen, Germany
Posts: 11,067
Thanks: 284
Thanked 3,412 Times in 3,142 Posts
You don't "log to putty", you login to a system using putty as a ssh client (or telnet as it has this as well). And, you can't do anything on a system without logging in with adequate authentication info, which in turn might be sth like a single sign-in or domain auth. setup, though.
What you could do is assign a script or a macro to a "hot key" in putty that would do all this for you.
Sponsored Links
    #3  
Old Unix and Linux 08-01-2015
Chi_SL Chi_SL is offline
Registered User
 
Join Date: Jul 2015
Last Activity: 7 August 2015, 1:49 AM EDT
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
is thi mean that we can't assign a short key to logging to a server?
    #4  
Old Unix and Linux 08-01-2015
agent.kgb agent.kgb is offline
Registered User
 
Join Date: Feb 2015
Last Activity: 12 July 2017, 3:16 PM EDT
Location: basement, Lubyanka, Moscow
Posts: 335
Thanks: 8
Thanked 97 Times in 86 Posts
you have to:
  1. create a profile in Putty
  2. generate SSH key and make password-less authentication using putty
  3. write a bat-file which starts putty with your profile and runs a command on the remote server
  4. assign a key to the batch
Sponsored Links
    #5  
Old Unix and Linux 08-03-2015
Chi_SL Chi_SL is offline
Registered User
 
Join Date: Jul 2015
Last Activity: 7 August 2015, 1:49 AM EDT
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks agent.kgb
I will follow this procedure.
Sponsored Links
    #6  
Old Unix and Linux 08-03-2015
Chi_SL Chi_SL is offline
Registered User
 
Join Date: Jul 2015
Last Activity: 7 August 2015, 1:49 AM EDT
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
I have done logging to the server via a .bat file.
But cannot understand how can I run a specified shell(.sh) using the same .bat file. Can you help?

my .bat file contains and it worked fine


Code:
E:\Share\putty.exe -ssh username@ip -pw password


Last edited by rbatte1; 08-07-2015 at 05:53 AM..
Sponsored Links
    #7  
Old Unix and Linux 08-03-2015
sea sea is offline
Registered User
 
Join Date: Sep 2013
Last Activity: 14 October 2016, 2:49 PM EDT
Location: Swissh
Posts: 1,285
Thanks: 256
Thanked 225 Times in 208 Posts
bat is BATCH
sh is SHELL/BASH

Unless you are on a *nix like machine, or windows within a cygwin, you wont be able to run the shell script.

You upload the shell script first to the *nix machine.
Then you call your bat file, which calls putty.
But give putty some more args, like -e /remote/path/to/script.
See putty /help for more details (if its -e as well) about execute a command.

hth
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem with script invoked from a keyboard shortcut gencon Shell Programming and Scripting 0 07-12-2012 06:03 AM
Putty shortcut and ssh to another server question, possible in bash? newb1000 Shell Programming and Scripting 5 08-18-2011 05:02 PM
Copy entire line in bash (terminal) - keyboard shortcut c_lady OS X (Apple) 2 03-28-2011 02:59 AM



All times are GMT -4. The time now is 01:04 PM.