Sunday 1 October 2017

linux - create text file on remote machine using plink/putty with contents of windows local machine's text file


I want to basically transfer a small text file ~10kb from a windows local machine to a linux machine through putty/plink. I cant use any file transfer tools like pscp/winscp etc So I'm think of getting my text file content to clipboard on window like this :


in cmd.exe in folder location where plink is present -



type text.txt > redirect this output to plink to create text file



I now want to redirect this clipboard text to plink session so that it could create a text file on the remote linux machine. how to I achieve this? Is this possible?



Answer



You don't need a pipeline, just use redirection:


 plink user@host hostfile"

This won't work (and neither will piping) if plink needs to prompt for a password; that means you must either:




  • have pageant running with a suitable client key loaded




  • use -i to specify an unencrypted client key (and an unencrypted key is usually a bad idea)




  • use -pw to specify the host password (unless the host prohibits password logons for this user)




No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...