How to share files on internet? (not lan)

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
miltonx
Posts: 158
Joined: Sat Nov 28, 2020 12:04 am
Has thanked: 12 times
Been thanked: 6 times

How to share files on internet? (not lan)

Post by miltonx »

Is there any tool for puppy linux to share file on WAN? (Ftpd seems to work only for visitors in the same local network.)
Have you tried sharing files, via ftp or any other protocol, so that EVERONE on the internet can download?
This may be further complicated by the fact that now most home or office computers are in a subnet behind the router.

User avatar
Phoenix
Posts: 341
Joined: Fri Feb 12, 2021 2:03 am
Location: Canada
Has thanked: 4 times
Been thanked: 48 times

Re: How to share files on internet? (not lan)

Post by Phoenix »

Sorry, you want the host to be publicly accessible to all so these files can be accessed? That means setting up a server and setting the necessary settings on the router to allow access to it.

IRC: firepup | Time to hack Puppy!

miltonx
Posts: 158
Joined: Sat Nov 28, 2020 12:04 am
Has thanked: 12 times
Been thanked: 6 times

Re: How to share files on internet? (not lan)

Post by miltonx »

Phoenix wrote: Thu May 05, 2022 4:15 am

Sorry, you want the host to be publicly accessible to all so these files can be accessed? That means setting up a server and setting the necessary settings on the router to allow access to it.

Yes, that's what I want, though I do not need a full function website. Just hoping to share a couple of files which I can download whereever I go.
I know that this can be done by placing those files on something like goole drive, but I am thinking if setting up a file sharing server like ftpd (but with internet accessibility) is possible. However, if it is too complicated, I'd rather give up and use web drives like google drive.

User avatar
OscarTalks
Posts: 623
Joined: Tue Jul 14, 2020 10:11 pm
Location: London UK
Has thanked: 2 times
Been thanked: 247 times

Re: How to share files on internet? (not lan)

Post by OscarTalks »

It is as Phoenix said above. In Puppy, there is pure-ftpd which you would need to have running at all times, with the files you want to make available placed in the correct location on this running Puppy computer. Also the router needs to be configured to allow access over WAN, which means port forwarding and firewall(s) allowing it as well. Not difficult, but this will mean you actually need to make changes from the default settings. So it can be done, but if it is just a small number of files which you want to make available to yourself (at other locations) and perhaps a small number of other people, it probably makes more sense to use one of the many providers of on-line file storage and sharing.

ozsouth
Posts: 1493
Joined: Sun Jul 12, 2020 2:38 am
Location: S.E. Australia
Has thanked: 228 times
Been thanked: 669 times

Re: How to share files on internet? (not lan)

Post by ozsouth »

@miltonx - several forum members use https://mediafire.com free account - works pretty well & allows sharing. Some of their ads are annoying tho.

miltonx
Posts: 158
Joined: Sat Nov 28, 2020 12:04 am
Has thanked: 12 times
Been thanked: 6 times

Re: How to share files on internet? (not lan)

Post by miltonx »

OscarTalks wrote: Thu May 05, 2022 5:03 am

It is as Phoenix said above. In Puppy, there is pure-ftpd which you would need to have running at all times, with the files you want to make available placed in the correct location on this running Puppy computer. Also the router needs to be configured to allow access over WAN, which means port forwarding and firewall(s) allowing it as well. Not difficult, but this will mean you actually need to make changes from the default settings. So it can be done, but if it is just a small number of files which you want to make available to yourself (at other locations) and perhaps a small number of other people, it probably makes more sense to use one of the many providers of on-line file storage and sharing.

Thank you for this further explanation. I thought Phoenix meant a complicated web server setup process, but the ftpd + port forwarding solution seems reasonably practical. I will look up router settings. Some nice reading expected.

miltonx
Posts: 158
Joined: Sat Nov 28, 2020 12:04 am
Has thanked: 12 times
Been thanked: 6 times

Re: How to share files on internet? (not lan)

Post by miltonx »

ozsouth wrote: Thu May 05, 2022 6:25 am

@miltonx - several forum members use https://mediafire.com free account - works pretty well & allows sharing. Some of their ads are annoying tho.

Looks like it offiers static file download link. Nice to have.

user1111

Re: How to share files on internet? (not lan)

Post by user1111 »

miltonx wrote: Thu May 05, 2022 7:24 am

Thank you for this further explanation. I thought Phoenix meant a complicated web server setup process, but the ftpd + port forwarding solution seems reasonably practical. I will look up router settings. Some nice reading expected.

Busybox ftpd, in a terminal run ...

mkdir /ftp
tcpsvd -vE 0.0.0.0 21 ftpd -w -a root /ftp

and in another terminal or using a ftp client you can ftp localhost and log in using 'anonymous' and upload/downfiles. BUT that assigns anonymous logins to userid root, so you can also cd /etc/ and download passwd ...etc files. SO you don't really want to do that. Instead its better to create a userid specifically for ftp, that is restricted from what it can see/do (what folders it can access). Fatdog supports creating such userids as its more real *nix like,

So more like

tcpsvd -vE 0.0.0.0 21 ftpd -w -a ftpuser /tmp/ftp

assuming you'd created/were using a userid of 'ftpuser'

Once you're comfortable that your ftp server is relatively secure then access your router admin pages and set Port Forwarding for port 21 (which is what FTP uses) to your PC/laptops IP (ifconfig should show its local IP such as 192.168.1.5 or whatever). Then anyone externally will also be able to ftp into that ... but using the external IP - that something like https://whatismyipaddress.com/ should show what that is.

There are services such as https://account.dyn.com/ where you can pick a friendly name and have that mapped to a IP, so others can use that name instead of having to type in/remember a IP.

For a always on home server, something like a pi or old laptop tend to use much less power than old desktop systems, otherwise over the course of a whole year the electricity consumption/cost can mount up.

Another choice is old BBS style, get a copy of syncterm, pick one of the thousands of BBS's around and log into that, where you can chat, share files, messages, play games ...etc.

Other choices is to setup a ssh server and use scp ... which is similar to regular cp (copy) but where one end as a remote host address (scp abc.txt user@some.host.com:/remote-folder/abc.txt).

Or use a site/service that caters for uploading/sharing files, but more often will entail ads and monetising your email/contact details etc.

User avatar
rockedge
Site Admin
Posts: 6378
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2579 times
Been thanked: 2534 times
Contact:

Re: How to share files on internet? (not lan)

Post by rockedge »

I use dyndns.org also, https://account.dyn.com/

There is a free version of this service for one domain name, one example is https://www.noip.com/

In the router port forward port 21 to the LAN IP of the computer that is running pure-ftpd.
IMPORTANT is to set a good root password

miltonx
Posts: 158
Joined: Sat Nov 28, 2020 12:04 am
Has thanked: 12 times
Been thanked: 6 times

Re: How to share files on internet? (not lan)

Post by miltonx »

rufwoof wrote: Thu May 05, 2022 10:34 am

tcpsvd -vE 0.0.0.0 21 ftpd -w -a root /ftp

Since I have not done any command line server stuff before, this syntax (with one command, ftpd, following another command, tcpsvd, without pipe or any connecting sign) looks weird to me, although I understand its funcational meaning. Is this syntax a special feature of "tcpsvd" command? Or is it a busybox thing?

rufwoof wrote: Thu May 05, 2022 10:34 am

and in another terminal or using a ftp client you can ftp localhost and log in using 'anonymous' and upload/downfiles. BUT that assigns anonymous logins to userid root, so you can also cd /etc/ and download passwd ...etc files. SO you don't really want to do that.

Does that mean the visitor can cd to any location in the host, even if the ftp shared folder is just /ftp?

williams2
Posts: 1059
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 302 times

Re: How to share files on internet? (not lan)

Post by williams2 »

https://github.com/schollz/croc
https://schollz.com/blog/croc6/

Fast, simple, and secure file transfer between any two computers.
sharing data should be fast, secure, and – most of all – easy
croc is a tool that allows any two computers to simply and securely transfer files and folders.

sic.

user1111

Re: How to share files on internet? (not lan)

Post by user1111 »

miltonx wrote: Fri May 06, 2022 6:33 am
rufwoof wrote: Thu May 05, 2022 10:34 am

tcpsvd -vE 0.0.0.0 21 ftpd -w -a root /ftp

Since I have not done any command line server stuff before, this syntax (with one command, ftpd, following another command, tcpsvd, without pipe or any connecting sign) looks weird to me, although I understand its funcational meaning. Is this syntax a special feature of "tcpsvd" command? Or is it a busybox thing?

rufwoof wrote: Thu May 05, 2022 10:34 am

and in another terminal or using a ftp client you can ftp localhost and log in using 'anonymous' and upload/downfiles. BUT that assigns anonymous logins to userid root, so you can also cd /etc/ and download passwd ...etc files. SO you don't really want to do that.

Does that mean the visitor can cd to any location in the host, even if the ftp shared folder is just /ftp?

tcpsvd involves parameters - of which ftp is one, and where ftp involves parameters such as the -w parameter that sets ftp to permit both reading and writing (download and uploading files, rather than just downloading alone). If you open a terminal and run tcpsvd --help ... it lists the parameters it supports, same for ftpd --help.

Busybox and others (such as dropbear) are similar - but different. They're coded such that they do different things according to the name they're actually invoked by. A single executable with multiple applets. In script terminology create a script

#!/bin/sh
echo $0

and make that executable, whatever name you like and when run that will print the name it was invoked as. Adding $1, $2 ...etc to that and any parameters the script was passed would also be printed. In a similar manner, but via binary code rather than script, busybox detects that it was invoked by a certain name and executes the respective code/action associated to that.

Yes if you allocate root as the userid for ftp then anyone accessing that can cd and download/upload whatever was available on the system. So usual practice is to have a dedicated userid that is restricted in where it can cd to and what it might see/do.

In practice for infrequent transfers just running passwd for root to change that to something modest/different before starting a ftp server running as root, doing your transfers, then turning the ftp server off and changing the root password again - is most unlikely to lead to any issues, more so when all of that occurs behind your main router firewall.

Post Reply

Return to “Users”