A coroutine (two-way pipe) seems to be overkill, since you are not waiting for the remote user/password prompt.
To do such a simple thing a here-document is enough:
The problem could be that you send the password too early.
If you are willing to wait for a password prompt then you need a two-way pipe and have to read -p before print -p.
Hello everybody,
I have a question about I/O redirection within a coprocess.
I want to setup a coprocess and then redirect output to a file on a remote machine.
Here's some Perderabo code modified
exec 4>&1
#
# Section 1 --- Prove that we can talk with the hosts in HOSTLIST
# ... (4 Replies)
I am wracking my brains over this. I am trying to use a Korn Shell script to execute an Oracle PL/SQL procedure, using the Oracle command line interface (sqlplus). The script starts sqlplus in a coprocess, and the two processes communicate using a two-way pipe. The bgnice option is off, so both... (8 Replies)
Hi all,
Just like to ask if it is possible to do the following:
1. Have a shell script that calls ssh username@destinationhost
2. Upon successful verification, we ssh into the destination host and automatically use ksh to run a shell script that resides in the destination host. (Hopefully no... (8 Replies)
Hi can any one let me know if awk doesnt work with the coprocess??? I have tried a simple example mentioned below but couldnt get it working seems like awk doesnt work with the coprocess concept. I would appreciate very much for any inputs on this.
exec 4>&1
awk -v count=$COUNT >&4 2>&4 |&... (6 Replies)
Is there a way to shorten these commands? because this script asks for a password 3 times
scp -p /usr/local/bin/${script_name} ${servername$iy]}://usr/local/bin/
ssh ${servernames} /usr/local/bin/${script_name}
ssh ${servernames} rm -f /usr/local/bin/${script_name}
Basically, I'm creating a... (3 Replies)
This is probably a simple one for the wise.
I have just started using a coprocess (first time) in order to facilitate telnet'ing from inside a shell script. It's working, but when I run a remote command I need to get the output into a local variable, but alas my kung-fu is weak.
#!... (10 Replies)
While assisting a forum member, I recommended running SQL/Plus in a coprocess (to make database connections and run a test script) for the duration of his script rather than starting/stopping it once for every row in a file he was processing.
I recalled I made a coprocess example for folks at... (2 Replies)
Hi,
I am trying to figure out a ksh script that i have and i think i found it but not sure.
i am having to scp or sftp files from my remote server over 2 others to the destination.
i have the rsa keys setup for the servers on my end and the username and password for the final server.
... (3 Replies)
Script name is test.ksh
I know that that the ssh command is working properly, this can be verified by the value returned in respond variable. It is unique to the remote server
_____________________________________________________
respond=$(ssh $remoteHost find... (3 Replies)
i have a script that should ssh to different host/server. See below:
./script.ksh var1 var2 var3
case $ser in
ser1)
depo='appr1'
set -A aprrA aprrB
ssh ser2 "/home/dir/script.ksh $1 $2 $3"
ssh ser3 "/home/dir/script.ksh $1 $2 $3"
ssh ser4... (4 Replies)
Discussion started by: erin00
4 Replies
LEARN ABOUT LINUX
ssh-copy-id
SSH-COPY-ID(1) General Commands Manual SSH-COPY-ID(1)NAME
ssh-copy-id - install your public key in a remote machine's authorized_keys
SYNOPSIS
ssh-copy-id [-i [identity_file]] [user@]machine
DESCRIPTION
ssh-copy-id is a script that uses ssh to log into a remote machine and append the indicated identity file to that machine's ~/.ssh/autho-
rized_keys file.
If the -i option is given then the identity file (defaults to ~/.ssh/id_rsa.pub) is used, regardless of whether there are any keys in your
ssh-agent. Otherwise, if this:
ssh-add -L
provides any output, it uses that in preference to the identity file.
If the -i option is used, or the ssh-add produced no output, then it uses the contents of the identity file. Once it has one or more fin-
gerprints (by whatever means) it uses ssh to append them to ~/.ssh/authorized_keys on the remote machine (creating the file, and directory,
if necessary.)
NOTES
This program does not modify the permissions of any pre-existing files or directories. Therefore, if the remote sshd has StrictModes set in
its configuration, then the user's home, ~/.ssh folder, and ~/.ssh/authorized_keys file may need to have group writability disabled manu-
ally, e.g. via
chmod go-w ~ ~/.ssh ~/.ssh/authorized_keys
on the remote machine.
SEE ALSO ssh(1), ssh-agent(1), sshd(8)OpenSSH 14 November 1999 SSH-COPY-ID(1)