Re: SFTPing a File From stdin



Unfortunately, I have no control over the server I'm connecting to.
WinSSHD is not based on cygwin so I have no unix commands at my disposal.
I was hoping there'd be some obscure option in sftp of scp that would
allow me to do this from the client. It seems like my only way out is to
write my own sftp client. This is what I get for proposing a "easy"
solution to my management. Thanks though!

--chris


On Wed, 12 Apr 2006 20:02:40 +0000, Darren Dunham wrote:

Me <Me@xxxxxxxx> wrote:
Is there a way to securely transfer a file from standard in? I know it's
possible when connecting to a UNIX server by doing this:

cat localFile | ssh user@host cat \> remoteFile

But I'm connecting to WinSSHD and there's no cat or dd command. I've tried
using the DOS "copy con:" command with no success. Anybody have any ideas?
I can't use temp files for reasons of security. Thanks!

I believe that WinSSHD is based on cygwin/OpenSSH. Presumably you could
install bash/cat/dd into the cygwin bits.

Or you could use a more complete cygwin installation and run OpenSSH
from it directly. Then you'd definitely have the file manipulation
capabilities.

Do you have activestate perl installed? Maybe push it into a perl
program?

cat localFile | ssh user@host 'perl -pe "1" > newfile' or
cat localFile | ssh user@host 'perl -e "$file=qq(>newfile);open(F,$file); while(<>) {print F $_;}"'

Sorry I'm not sure of the particulars of WinSSHD and how it interacts
wit the command shell.

.



Relevant Pages

  • Re: SFTPing a File From stdin
    ... WinSSHD is not based on cygwin so I have no unix commands at my disposal. ... But I'm connecting to WinSSHD and there's no cat or dd command. ... An easy solution would be to install CopSSH which is based on cygwin. ...
    (comp.security.ssh)
  • Re: SFTPing a File From stdin
    ... using the DOS "copy con:" command with no success. ... I believe that WinSSHD is based on cygwin/OpenSSH. ... install bash/cat/dd into the cygwin bits. ... Or you could use a more complete cygwin installation and run OpenSSH ...
    (comp.security.ssh)
  • Re: The most notorious command
    ... I didn't say a 'nix OS, I said a 'nix *derivative shell*. ... Do you know what OS CygWin would be running on? ... Is a properly configured Windoze box any more or less "fragile" than a properly configured 'nix box (relative to this command)? ... Any modern OS can be configured to allow or disallow that command and to behave differently on various files based on individual access rights. ...
    (talk.origins)
  • plink 0.60 ignoring command options for hostname and username.
    ... with Cygwin and full PuTTy package loaded. ... I tried the same thing using hostname, but plink wants to look up ... the command intelligently. ... Initialised HMAC-SHA1 client->server MAC algorithm ...
    (comp.security.ssh)
  • Re: Running ssh under cygwin
    ... Cygwin has a /home directory and uses ... Using a cygwin command is ... in general are not bothered by Unix-style forward slashes. ... your own system more closely before generalizing so broadly. ...
    (alt.os.linux.redhat)