How do I upload a local file to a remote machine running over SSH with lsh
? There are enough examples on the Internet for ssh
but I am interested in doing it with lsh
.
Here is what I tried with an MP3 file:
$ cat file.mp3 | lsh -l pi -c aes256-ctr --sloppy-host-authentication raspberrypi.local "cat > file.mp3"
$ lsh -l pi -c aes256-ctr --sloppy-host-authentication raspberrypi.local "cat > file.mp3" < file.mp3
$ tar -c file.mp3 | lsh -l pi -c aes256-ctr --sloppy-host-authentication raspberrypi.local "tar -x"
All of this results in a file named exactly as the file which I am sending but completely empty.
$ ls -l file.mp3
-rwxr-xr-x 1 pi pi 0 Feb 24 06:55 file.mp3