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


 
Thread Tools Search this Thread
Special Forums Windows & DOS: Issues & Discussions Method to run a shell script using shortcut key in keyboard with out logging to putty
# 1  
Old 07-31-2015
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
# 2  
Old 07-31-2015
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.
# 3  
Old 08-01-2015
is thi mean that we can't assign a short key to logging to a server?
# 4  
Old 08-01-2015
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
# 5  
Old 08-03-2015
Thanks agent.kgb
I will follow this procedure.
# 6  
Old 08-03-2015
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 06:53 AM..
# 7  
Old 08-03-2015
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
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with script invoked from a keyboard shortcut

-EDIT- I have solved my problem below by using a different program. Instead of xsel I am using xclip which basically does the same thing and works fine from a script invoked by a global hotkey. -END EDIT- Hi, I've written a simple script to copy my email address into both the... (0 Replies)
Discussion started by: gencon
0 Replies

2. Shell Programming and Scripting

Putty shortcut and ssh to another server question, possible in bash?

Hi, sorry if this is the wrong forum for this question but I couldnt spot another obvious forum for it. I have a windows shortcut which opens up a saved session in putty. From this session I then ssh to another remote server. I was wondering is there a way that I can either edit my shortcut... (5 Replies)
Discussion started by: newb1000
5 Replies

3. OS X (Apple)

Copy entire line in bash (terminal) - keyboard shortcut

how can I do that? I can paste a line with ctrl+p; but I dont know how to copy it? ctrl+y - just deletes etc. (2 Replies)
Discussion started by: c_lady
2 Replies

4. UNIX for Dummies Questions & Answers

Wanting to run a macro/script from PuTTY

We currently use TUN as an emulation program to connect to various unix applications. I am looking at moving to PuTTY release 0.60 but am getting stuck as one application runs a macro at startup to run a program. My question is, can you run a macro from PuTTY? Any pointers would be great. (0 Replies)
Discussion started by: virtualpaul
0 Replies

5. UNIX for Dummies Questions & Answers

Starting terminal with shortcut key combination

How can the shortcut keys be defined that would open up a terminal window? When using a kvm switch, the mouse sometimes does not work, but the keyboard does, and by opening up a terminal window using a shortcut key combination, the mouse can be restarted by entering the predefined mouserestart... (0 Replies)
Discussion started by: figaro
0 Replies

6. UNIX for Advanced & Expert Users

All Shortcut key combinations

Hi, I am using the Korn-Shell (ksh) and would like to know all the shortcut keys. For example: Shift + Insert etc. Thank you very much. Take care (0 Replies)
Discussion started by: --crimson--
0 Replies
Login or Register to Ask a Question