General :: Call Putty/plink To Start A Remote SSH Script With User Input?
Jan 18, 2010
Execute putty to start a script on a remote linux server which requires user input The remote script does a read -p "Please enter name" NAME I can use plink to execute a script over SSH, the following attempts and problems are shown below :- Note the -load ns is to load a session that doesnt exist, ie ensure no defaults are used
1) plink.exe -load ns <ip_addr> -l <user> -pw <password> <script path/name> Problem) Doesn't allow/show user input, ie its non-interactive.
2) Add -t to allocate a pty :- plink.exe -t -load nc <ip_addr> -l <user> -pw <password> <script path/name> so now the user input can be seen, but I get Ctrl+H (^H) when backspace is pressed, ok if the user doesnt make a mistake!
3) Use putty instead with a saved session putty.exe -load "SavedSession" Get a new window opened, not a biggy, but not as nice. (b) saved session cannot be easily moved. (c) Get password prompt, cannot provide password like with plink, I know I know, use keys, but this is a closed, private network, and its easier not to bother with keys!I would like the SSH to execute in-line, that is from within the batch file/command line shell I am in, not prompt for username/password, run the linux script and allow prompts and delete/backspace to work.
View 5 Replies
ADVERTISEMENT
Jun 27, 2011
Seemingly simple question, which yields slightly undesired results. Execute putty to start a script on a remote linux server which requires user input The remote script does a read -p "Please enter name" NAME I can use plink to execute a script over SSH, the following attempts and problems are shown below :-
Note the -load ns is to load a session that doesnt exist, ie ensure no defaults are used
1) plink.exe -load ns <ip_addr> -l <user> -pw <password> <script path/name> Problem) Doesn't allow/show user input, ie its non-interactive.
2) Add -t to allocate a pty :- plink.exe -t -load nc <ip_addr> -l <user> -pw <password> <script path/name> Problem) Ok, so now the user input can be seen, but I get Ctrl+H (^H) when backspace is pressed, ok if the user doesnt make a mistake!
3) Use putty instead with a saved session putty.exe -load "SavedSession" Problem) (a) Get a new window opened, not a biggy, but not as nice. (b) saved session cannot be easily moved. (c) Get password prompt, cannot provide password like with plink, I know I know, use keys, but this is a closed, private network, and its easier not to bother with keys!
So ideally, I would like the SSH to execute in-line, that is from within the batch file/command line shell I am in, not prompt for username/password, run the linux script and allow prompts and delete/backspace to work.
View 1 Replies
View Related
Jan 10, 2010
I'm trying to figure out how to start/stop gqview remotely from a batch script on a windows machine. Stopping works with killall but starting gives me a
Code: Gtk-Warning **: cannot open display warning.
Is this because it tries to open a GUI in the terminal and if so how to solve this?
View 4 Replies
View Related
Nov 6, 2009
I want to run the scripts on remote system using plink. Here I am using pipes concept .I created two pipes And I want to handle the output and error in two different files. If host key (available in /.putty/sshhostkeys file) is not available or is not match then we will get "Store key in cache? (y/n)" message from child process into error file. If parent process reads this message then we will send "yes" if not then we will continue to next step and parent process will wait until exit child process .
In this bug case, host key did not match and response came late from child process into error file and parent process took it as host key already available and waiting for exit status of child process using waitpid(). But here "yes" did not send for running commands and exit the child process.Hence it is hanged at waitpid(). Please help me how to solve this issue.
I tried this in following way:
#include<stdio.h>
#include <unistd.h>
#include <sys/types.h>
[code]....
View 1 Replies
View Related
Jan 5, 2011
I am out of ideas of how to run videos at a remote machine that has a display. I have a debian system with gnome installed and everything is set up but I just don't now how to start the video over anything. I have tried simply to start #vlc video file - but this way it thinks that I want to run it in my bash over at a nother computer. I tried installing vnc but this just ports a new desktop and masically is a terminal which does not give me any control over the display.
View 7 Replies
View Related
Nov 25, 2010
I have X Window running on one of RHEL Machine 192.168.2.2.I have logined through putty from remote Windows Machine 192.168.2.5. Now What I need to open the xterm (if I run the command through putty it should open xterm in the linux Machine).
View 2 Replies
View Related
Jun 5, 2011
I have a database in SQL Server 2005 in my local Windows System and I want to import this database to my linux (ubuntu) server remotely using putty.
View 5 Replies
View Related
Jan 13, 2010
I am trying to get two way serial communications going between a Windows XP system and a Linux system (RHEL 5).I have /sbin/agetty -L 9600 ttyS0
in /etc/inittab. I am using a generic USB to serial adaptor on Windows (Unitek) and a null modem cable. I have putty configured for 9600 baud, 8 bits, no parity, one stop bit, no flow control.I get the login prompt from agetty in the putty window but input does not work; I see weird characters in the putty screen. I can echo output into the device from windows and see it, but
cat < /dev/ttyS0. just prints out weird characters from what I type.
View 3 Replies
View Related
Jul 25, 2011
I have logged into one Linux VM and I want to test remote access to another Linux server on the same network but I cannot recall the Linux application to call?
View 10 Replies
View Related
Apr 23, 2010
I am trying to remotely access a linux machine to run Cadence from my laptop.I downloaded Putty and Xming/XLaunch.I run Putty, enable X11 forwarding, then sign into my host address.I am successfully able to access and navigate through my home directory, however once I try and run Cadence, I get the attached error.
View 4 Replies
View Related
Jun 25, 2010
I am using CentOs 5.5.
I use Putty to ssh from my windows laptop to a remote CentOS machine. Is there a way to start a shell that doesnt dies when I disconnect so I can connect again and reclaim it?
View 3 Replies
View Related
Nov 5, 2009
I have a section of a script that is supposed to change the filename of similar files in a directory. It works the way I need it to work, except that I would like to input the new filename each time it runs without having to edit the script.
I capture 5-6 images into ~/screenshots. They are labeled Picture 1.png, Picture 2.png, etc. I would like to be able to rename them as Lesson 1.png, Lesson 2.png, and so forth. It works if I hardcode the new NAME (Lesson) into the script, but I want to replace NAME with a variable that I can input at a prompt or pass into the script from another. I have tried setting a variable and replacing "Lesson" with $variable in line #11, but that leaves me with only the extension and no filename.
I have also tried using $1 on the command line:
Here is what I have that works:
How do I get a variable into this script?
View 2 Replies
View Related
Apr 8, 2010
I have a script in which it searches the password file for a username based on the user's input. Is there a way I can take the bad input and keep it in a variable. (one that keeps adding all the non-existent users)so how would I get non-existent users into another variable?
View 9 Replies
View Related
Apr 9, 2011
The Remote Procedure Call (RPC) protocol uses only TCP, or is it possible to use RPC over UDP?
View 1 Replies
View Related
Dec 2, 2010
I want ssh a remote server through shell script with predefines username and passwd. i dont know how to use expect command to do that.
View 4 Replies
View Related
Dec 4, 2010
I'm trying to create a backup script. For my second version, I want to make a GUI that will ask the user three things:
1. which folders should be excluded
2. where to store the backup
3. the user's email
I need to store this input, and later input the values into variables in my script. How do I go about doings this?
View 1 Replies
View Related
May 5, 2011
I have a program that I run from the terminal that requires manual input (it's matlab in mex debugging mode, matlab -Dgdb, which starts the GNU C debugger with its own custom settings).
Every time I run this program I always type in the same few commands in the program's interactive shell before I actually start working (for example: run -nojvm; stop at mexFunction; continue). I want to avoid typing these commands and I thought I could do this with shell scripting, saving the commands in the mycommands file, then running: myprogram < mycommands
The problem is that this runs all the commands and then exits the program. I want it to run the commands and return control to me so I can run my commands. Is there a way to tell the shell to use a file or a string as the input to a program then immediately return control to the user without the exiting the program?
View 3 Replies
View Related
Nov 3, 2010
i can start applications like Openoffice, firefox and other graphical app inside terminal on gnome.
View 3 Replies
View Related
Nov 28, 2010
I am new to writing shell scripts. So, please bare with me. I am currently trying to write a shell script which will read the directory path as input from user and will traverse the Dir tree to find all available audio and video files. I have tried to write as much as I could but I don't know where I am making mistake as I get some files to be audio file which are actully tar balls. On the second note there are some files which video but script shows them to be audio. And, some video files are completely skipped. I am giving the shell script below so that you can see. I am using two external files as source which I am attaching.
Code:
#!/bin/bash
#Let's load the extensions that we want to search for
vdExt=$(cat vdExtList)
adExt=$(cat adExtList)
[code]....
View 5 Replies
View Related
Jul 8, 2010
i have to install app server on VM of Linux box. am able to connect Linux box via puTTY and Xmanager as root user. but am not able to connect as a normal user. in Xmanager i see network error. In puTTY console gets disappear
View 1 Replies
View Related
Mar 16, 2010
I have a BASH script which at one point asks the user a yes/no question. I want to make it so that if the user types in an invalid input 3 times consecutively then the BASH script will echo an error and terminate with exit status 1.
View 9 Replies
View Related
Mar 16, 2010
I have debian as an NFS client. I would like to mount a remote NFS with a specific user permissions (to specify the remote user account)
View 2 Replies
View Related
Jun 9, 2010
I want to connect to a server via ssh and log in (remotely) a user in X11 (gdm).A little context: I need to install a wine application in 30 computers, but wine require X11, there is nobody loged there, so wine does not work properly. I want to remotely login in display=:0.0 a user so this user receive the window (it only start and close), there i need to ()neThere is no one logged on there. I need to start a graphical app there (wine installer) but I cannot because it needs a display with X11 (to open a wineconsole).
Resumen: Is it posible to log a user remotely on X11 My config: every computer have fedora 10 and gnome. Clarification: I do not want to do X-forwarding, I want to show the window on the remote computer, not mine. I want to log the user on the remote computer. If I go (fisicali) to the computer, the user should be logged on.
Update: I asked to gdm developers, but I had no answers... I'm starting to think there is no way. The only option I can think is to config autologin, restart gdm, and get the config normal again (all by script) But I have to read a lot for that and is not so important, I prefer to log in manualy 30 times.
View 6 Replies
View Related
Dec 7, 2010
I've been trying to make a cgi script that starts a program on a server and then shows the program on the servers screen. The cgi script is written in perl. I've been successful in making the program showing up on the screen through ssh by setting $DISPLAY to :0.0, I tried setting it to this in /etc/profile but when the cgi script ran nothing showed up on the screen. I tried having the script running it as a local user with "su - [user] -c [command]", this didn't help either.
In short what I'm trying to accomplish. When I press a button on a web page an slide show is supposed to start on a screen connected to the server.
View 2 Replies
View Related
Nov 13, 2010
I want to start a shell scripts(which generate traffic to test my network) at remote linux hosts from single linux local host.. If i start script at remote host through ssh, all traffic are sending from my local host also. It will create burden on my local host. If i terminate SSH connection, it stopping the script at remote host. Also i need to do ssh to all my remote hosts.
Is there any best way to do it?
View 6 Replies
View Related
Jun 8, 2011
I am trying to ssh a remote box from putty but I am getting following error. "No supported authentication methods available" I don't have access to the server so I must have make my ssh client compatible to ssh server. This is the trace from another client
[SSH] Protocol Version 2 (OpenSSH_5.3p1 Debian-3ubuntu6)
[SSH] Cipher: aes128-ctr
[SSH] FAIL: Unable to authenticate
[SSH] INFO: DISCONNECT
View 2 Replies
View Related
Aug 27, 2010
PuTTY SFTP syntax required to copy a file from computer 10.0.2.2, on user t0p's Desktop (eg /t0p/Desktop/file.txt , to the XP computer? The PuTTY instructions seem to make no sense to me.
View 1 Replies
View Related
Jul 27, 2009
I looked around for threads addressing this issue and some have come close to answering it, but I have yet to see a definitive yes or no. Anyway - Here's my issue:
Background:
I can SSH into my home computer (Ubuntu 9.04 running Gnome) from work (Win XP Pro) using RealVNC via Putty tunnels. This has been working flawlessly for me for awhile now. I was messing around in the terminal window and accidentally rebooted the linux box (home computer) while I was at work. No big deal I thought. So I re-start the Putty connection, and it is back up in no time. Then I try to start the VNC connection, and no go, connection refused. I remember seeing that in order for the VNC connection to work, I had to be logged into the Gnome desktop already on the Ubuntu box.
Question:
Is it possible to log in and start up a Gnome desktop session from the terminal command line in Putty so I can get the VNC connection back?
View 8 Replies
View Related
May 15, 2010
I am trying to setup a putty session to putty from one Ubuntu machine to another. I know how to setup to connect to the machine from Windows and I am using the same settings for the one I am trying on the Ubuntu machine but it fails to connect. It fails immediately so I believe that putty is not able to find ssh. Is there some configuring that I need to do.
View 7 Replies
View Related
Nov 11, 2010
How to start a remote login session from script to any server?
View 1 Replies
View Related