|
PowerBASIC Forums
![]() PowerBASIC Console Compiler
![]() calling SCP from SHELL
|
| next newest topic | next oldest topic |
| Author | Topic: calling SCP from SHELL |
|
mark williams Member |
Issue: responding to password request from SCP Host My program creates an SCP command line call and then The SCP Host then sends back a message asking for the This is where my plan falls apart. I can get the password Any suggestions? I am using PBCC2.1 ------------------ IP: Logged |
|
Florent Heyworth Member |
SCP? You mean Secure Copy Protocol? Are you using PSCP from the author of Putty? If that's the case the better way to make unattended secure ------------------ IP: Logged |
|
Michael Mattias Member |
quote: If SCP is looking for that password via its STDIN, instead of SHELL you might use CreateProcess with the USESTDHANDLES flag. You can pass a handle to a disk file in which you have stored that password + CRLF. I know there's an example of using CreateProcess with redirected input 'somewhere' on this board, but if you can't find it, you might be able to work it out from the MDSN doc. MCM IP: Logged |
|
mark williams Member |
Here is the security issue around using that approach: Any user on that client box could then open a DOS box, key in >ssh ame01.jones-i.com, and they would be able to access our server Any other ideas about how to send that Thanks. ------------------ IP: Logged |
|
Michael Mattias Member |
quote: If by "that approach" you are referring to my suggestion of trying to use SCP stdin (can't tell)... 1. Your front end program prompts user for id/password, which they validate The only "hole" here is while the file exists, but if you open that file for exclusive access, that hole is gone, too. As I said before, I don't know how "scp" expects its input.. but it's easy enough to test on your end by executing 'scp' from the command line with input redirection (just use a "notepad" text file containing password + CRLF). If that works, then this CreateProcess method will work, and if you are not comfy with writing it yourself, you can always contract with someone (said he, not so subtly hinting at what he does for a living). ------------------ IP: Logged |
|
mark williams Member |
Thanks, Michael. When I said "that approach" I was referring to using a I tried the redirected input from the commandline approach: scp test.tab xyz@ace.acme.com:ghjk/special/ < C:\temp\pw.txt It does not work. The SCP host still asks for the password. I do not want to prompt the user for the password. I want it I would be okay with holding the password in a disk file it is Thanks for examining this problem. ------------------ IP: Logged |
|
Florent Heyworth Member |
[QUOTE] Here is the security issue around using that approach: Any user on that client box could then open a DOS box, key in >ssh ame01.jones-i.com, and they would be able to access our server Here's a possible approach to the Public key problem On the client side encrypt the client key. Use You can pass the path to the de-encrypted key as a command Not foolproof of course but then neither is passing the If you have a wrapper program which contacts the server first ------------------ IP: Logged |
|
mark williams Member |
Florent, Thanks for thinking about this. I have two problems. (1) Our security team will not allow copying the pair to (2) SCP will not allow the calling application to pass You're right about encrypting the client password; we're In order for a wrapper program to send a secure message to Thanks for thinking about it! I am open to buying 3rd party software if we need to... -Mark ------------------ IP: Logged |
|
Florent Heyworth Member |
In that case check out http://www.bitvise.com/sshlib.html You'll probably have to program it yourself using their API I'd go for version 2 - on the other hand the Bitvise solution will probably Cheers Florent [This message has been edited by Florent Heyworth (edited February 12, 2004).] IP: Logged |
|
Don Dickinson Member |
actually, the scp program (pscp.exe) that comes with putty *has* the ability to take a password on the command line. i also tested that it returns a result code of 1 on success on 0 on failure. --don ------------------ IP: Logged |
|
Chuck Hicks Member |
quote: Yup: pscp -pw mypassword myusername@myhost:hostdir/hostfile localdir/localfile ------------------ IP: Logged |
|
mark williams Member |
Many thanks to you, Don, for your off-line support on this. Excellent work! Also, thanks to everyone for their advice. It all helped.
quote: ------------------ IP: Logged |
All times are EasternTime (US) | next newest topic | next oldest topic |
![]() |
|
Copyright © 1999-2005 PowerBASIC, Inc. All Rights Reserved.