Plink problem....only works if passwd is in the script


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Plink problem....only works if passwd is in the script
# 1  
Old 08-29-2006
Error Plink problem....only works if passwd is in the script

I have a one line bat script run off a XP machine that tar's and compresses some files from a Sol 8 box. It goes something like this (a bit simplified)....

plink -pw <passwd> user@host "tar -cvf - -C / tmp/a_file | compress " > a_file.tar.Z

So this works....and it's worked many times. But now I can't have the password in the script. So I've tried many variations of the command. But once I have the tar.Z on the XP machine, WinRAR complains about the archieve (corrupt or can't read it).

So far I've tried:

plink user@host .....
plink host.....
plink -l user host.......
plink host -l user.....

Any advice or tips would be appreciated Smilie

-Yinzer
# 2  
Old 08-29-2006
Can you run the bat file interactively and enter the password as a parameter, substitute the parameter in the script.?

You can also set up authentication keys on the remote unix host, if it is allowed. That suppotts the plink host -l username format without having to enter a password.

Last edited by jim mcnamara; 08-29-2006 at 02:10 PM..
# 3  
Old 08-29-2006
Quote:
Originally Posted by jim mcnamara
Can you run the bat file interactively and enter the password as a parameter, substitute the parameter in the script.?
I guess I should try huh Smilie I had to do that for some Unix scripts the other day. This may be a long and painful experiment hehe.....
# 4  
Old 08-29-2006
Question....

How do you read user input in Windows? Smilie


edit: Got it......used SET /p var=some text

Last edited by Yinzer955i; 08-29-2006 at 04:18 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Plink wait problem

Hi, I have run into a problem to which i can't seem to find any solution, posting here is my last resort. Problem: I am using plink to access my router and run a few configuration commands. When in enter configurations mode, instead of sending next command plink keeps on waiting for manual... (7 Replies)
Discussion started by: zaainabbas
7 Replies

2. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies

3. Shell Programming and Scripting

Problem with output file plink GWAS

hi, Can anybody help me about the odd output file yielded by the following command: plink --noweb --allow-no-sex --bfile input_file --assoc --adjust --out output_file In fact, I'd like to perform a simple Bonferroni basic association test, and I obtains the following output file (extract... (1 Reply)
Discussion started by: boro82
1 Replies

4. Shell Programming and Scripting

Execute Shell script via Plink

I am trying to create a bat file with the below piece of code. plink.exe -l username -pw password -P 22 -2 -ssh servername sudo su - devuser cd /opt/sample echo 3 | ./Script.sh It executes only the first line and not the rest of the lines. Can you please help me where am I doing wrong? (5 Replies)
Discussion started by: lingu85
5 Replies

5. Programming

Problem with Pipes => Only works first pipe

Hi! I'm having problems with pipes... I need comunnications with childs processes and parents, but only one child can comunnicate with parent (first child), others childs can't. A brief of code: if(pipe(client1r)<0){ perror("pipe"); } ... (1 Reply)
Discussion started by: serpens11
1 Replies

6. Solaris

Solaris passwd problem

Hi, I am using solaris 10. i am facing a strange problem regarding os passwd. i have a user oracle with passwd abc123 when i open a putty session with the os using abc123 it logs on. but if i use abc123!@# it agian log on without passwd error. I came to know about the issue that if i... (5 Replies)
Discussion started by: malikshahid85
5 Replies

7. Programming

C++ - Problem in asking and checking user's passwd

This is the source code: #include <pwd.h> #include <iostream> #include <string.h> using namespace std; int main() { struct passwd *user; char login="alex", password="qwertyuiop"; if ((user= getpwnam(login)) == NULL) cout << "No such user\n"; else if... (24 Replies)
Discussion started by: hakermania
24 Replies

8. Homework & Coursework Questions

How join works and the specific parameters to my problem?

1. The problem statement, all variables and given/known data: I have two files created from extracting data off of two CSV files, one containing class enrollment on a specific quarter and the other containing grades for that specific quarter. The Enrollment file generated contains course name,... (11 Replies)
Discussion started by: Lechnology
11 Replies

9. Emergency UNIX and Linux Support

Passwd command problem

on Runnning passwd command on HPUX 11.23 I am getting pam_chauthtok: Shared object load failure. Pls help ... (13 Replies)
Discussion started by: ultimatix
13 Replies

10. Shell Programming and Scripting

plink and shell script

This is my shell script... test.sh DIRECTORY=/XYZ/PQR if ; then echo "In test.." else echo "lno.." fi when i run this script through a putty its output is: ./test.sh: line 2: [: too many arguments lno.. But when i run the same script using plink its running fine and its... (5 Replies)
Discussion started by: praveen.1
5 Replies
Login or Register to Ask a Question