topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 10:36 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Easy file sharing from the Linux command line  (Read 8006 times)

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,747
    • View Profile
    • Read more about this member.
    • Donate to Member
Easy file sharing from the Linux command line
« on: April 07, 2019, 07:02 PM »
Recently I was wondering how I could get a file from a headless Linux VM onto a different Windows machine, and thought it would be super useful to have some kind of file sharing service which could be accessed from the command line. Almost like a pastebin, but for files rather than just text.

A quick search revealed something called transfer.sh which allows you to send files up to 10 GB with no complicated setup required.

  • Made for use with shell
  • Share files with a URL
  • Upload up to 10 GB
  • Files stored for 14 days
  • For free
  • Encrypt your files
  • Preview your files in the browser

An example of how to use it:
$ curl --upload-file ./hello.txt https://transfer.sh/hello.txt

And there's even an onion link:
http://jxm5d6emw5rknovg.onion/

I'd never heard of it but searched the DC forum in case I'd missed some previous mention of it, and found that a relatively new member of the forum posted a link using it just a couple weeks ago, here: https://www.donation....msg428747#msg428747

It's open source, too, so if you want to host it yourself you can do that:

This code contains the server with everything you need to create your own instance.

Transfer.sh currently supports the s3 (Amazon S3), gdrive (Google Drive) providers, and local file system (local).

I hope others here find this useful.
« Last Edit: April 20, 2019, 02:25 PM by Deozaan »

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: Transfer.sh - Easy file sharing from the command line
« Reply #1 on: April 07, 2019, 07:32 PM »
NextCloud or similar software running on your own computers.

That works as well. Not difficult, but not as easy, of course. Still, an interesting learning experience to make it work and you can run this on a as-needed basis. Can communicate with Azure, AWS or other cloud services as well, if so desired.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: Transfer.sh - Easy file sharing from the command line
« Reply #2 on: April 07, 2019, 09:25 PM »
I created something like that using Nancy for the company that I work for- it's nice to see an alternate implementation.  I use SyncThing and Synology Cloud Station, but it's nice to have a simple service where you can just perform a put then a get to retrieve it sometimes- especially hitting it using cUrl or something similar.

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,747
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Transfer.sh - Easy file sharing from the command line
« Reply #3 on: April 07, 2019, 09:46 PM »
This is slightly off-topic since it's not a command-line utility, but if you're just looking for a way to quickly send some file(s) to yourself or others, without needing long-term storage, there's Firefox Send.

Firefox Send lets you share files with end-to-end encryption and a link that automatically expires. So you can keep what you share private and make sure your stuff doesn’t stay online forever.

c.gingerich

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 748
    • View Profile
    • The Blind House
    • Donate to Member
Re: Transfer.sh - Easy file sharing from the command line
« Reply #4 on: April 08, 2019, 11:53 AM »
That sounded really cool, but I am not able to get to transfer.sh, it seems to be down :-(

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: Transfer.sh - Easy file sharing from the command line
« Reply #5 on: April 08, 2019, 12:53 PM »
That sounded really cool, but I am not able to get to transfer.sh, it seems to be down :-(

I noticed that yesterday and went right to the github.  That address worked.

https://github.com/d...hcoders/transfer.sh/

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,747
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Transfer.sh - Easy file sharing from the command line
« Reply #6 on: April 08, 2019, 01:24 PM »
Yeah. The site was working for me yesterday. But today I actually tried to use it and it failed. :(



Actually, I just tried again and it seems to be working for me now. :Thmbsup:

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: Transfer.sh - Easy file sharing from the command line
« Reply #7 on: April 08, 2019, 03:16 PM »
Yeah. The site was working for me yesterday. But today I actually tried to use it and it failed. :(



Actually, I just tried again and it seems to be working for me now. :Thmbsup:

When it is working, Malwarebytes prevents me from going to it with a Trojan warning.

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,747
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Transfer.sh - Easy file sharing from the command line
« Reply #8 on: April 08, 2019, 05:47 PM »
When it is working, Malwarebytes prevents me from going to it with a Trojan warning.

That's because it's a file hosting site. So somebody probably uploaded malware to it at some point in the past and it got flagged by Malwarebytes.

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,747
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Transfer.sh - Easy file sharing from the command line
« Reply #9 on: April 17, 2019, 04:06 PM »
And it's down again for me.

It never works when I need it.  >:(

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: Transfer.sh - Easy file sharing from the command line
« Reply #10 on: April 17, 2019, 04:33 PM »
And it's down again for me.

It never works when I need it.  >:(

You could host your own instance...

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,747
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Transfer.sh - Easy file sharing from the command line
« Reply #11 on: April 17, 2019, 05:32 PM »
Looks like it's built using Go. I'm not sure I have the proper access/authority to run Go services on my host.

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,747
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Transfer.sh - Easy file sharing from the command line
« Reply #12 on: April 17, 2019, 05:36 PM »
In the meantime, I found out about another option that I think I'll have to give a try: Woof.

$ sudo apt install woof
$ woof ./somefile.txt
Now serving on http://192.168.0.117:8080/
« Last Edit: April 17, 2019, 05:42 PM by Deozaan »

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
Re: Transfer.sh - Easy file sharing from the command line
« Reply #13 on: April 19, 2019, 03:52 PM »
Slightly off topic since it's not really a single CLI based program, (but it does mention transfer.sh so ...):

awesome-selfhosted (link to the file share/sync section) lists some interesting possibilities, (PsiTransfer looks good).
« Last Edit: April 19, 2019, 11:24 PM by 4wd »

Edvard

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,017
    • View Profile
    • Donate to Member
Re: Transfer.sh - Easy file sharing from the command line
« Reply #14 on: April 20, 2019, 01:38 PM »
In the meantime, I found out about another option that I think I'll have to give a try: Woof.

$ sudo apt install woof
$ woof ./somefile.txt
Now serving on http://192.168.0.117:8080/

Hey, that's a nice one!  I usually end up using Civetweb to share things locally, but it's more of a generic web or folder content server, not a single file.  Being able to serve just a single file would make things a few keystrokes easier on the getter side. Thanks! :Thmbsup:

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 205
    • View Profile
    • Donate to Member
Re: Easy file sharing from the Linux command line
« Reply #15 on: April 22, 2019, 01:45 AM »
Hi. How about good old FTP?

You could just start ftpdmin on the Windows machine, and connect to it using your command line ftp client from the headless Linux.

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: Easy file sharing from the Linux command line
« Reply #16 on: April 22, 2019, 10:18 AM »
Did you try this over a VPN?

I made a script for transferring files. By default it tries to send files using WebDAV, but in the case that fails, the script uses FTP as a fall back option. I make use of this FTP server software (simple, free for 3 users) and the default FTP commands available with the MS command line.

There are pretty severe limitations in the location where I need to generate the files I need to pull to my location. If this would make that whole setup even easier, I would consider to alter my script.   


Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,747
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Easy file sharing from the Linux command line
« Reply #17 on: April 22, 2019, 11:20 AM »
I've used woof a few times now, and I'm pretty happy with how it works for me. Super simple to install, no configuration necessary, and a simple command handles everything to transfer the files I need. :Thmbsup: