I have logged on to a system with ssh and there is no scp present on both the systems. How to copy a file without using the scp program.
Asked
Active
Viewed 1.3e+01k times
5 Answers
152
To send a file:
cat file | ssh ajw@dogmatix "cat > remote"
Or:
ssh ajw@dogmatix "cat > remote" < file
To receive a file:
ssh ajw@dogmatix "cat remote" > copy
Michael come lately
- 1,185
3
You can use xxd and some ugly quoting to copy over multiple files as well as run commands on them and execute them:
ssh -t foo@bar.com "
echo $'"$(cat somefile | xxd -ps)"' | xxd -ps -r > "'somefile'"
chmod +x somefile
echo $'"$(cat someotherfile | xxd -ps)"' | xxd -ps -r > "'someotherfile'"
chmod +x someotherfile
./somefile
./someotherfile
"
Michael come lately
- 1,185
Aric
- 31
-1
python3 -m http.server in the same directory with desired file - after that you can curl or wget or download a file with your browser. Note that with that running command all your files from current directory will be publicly available, until you press Ctrl+C.
Vitaly Zdanevich
- 211
- 1
- 4
- 19
-2
Besides piping the file to a remote cat, you may also be able to use some SFTP client to transfer the files.
salva
- 179