0

I've been trying to search but keep getting results on how to remotely install Linux and how to send files to another Linux computer, and can't find what I'm trying to do.

I would like to be able to send a URL to my Linux PC from across a network or across the internet (I can set my router to give my PC an internet-side IP so this is not an issue).

I do not want to have to login using remote desktop. Just a simple interface preferably web-based to paste in a URL and have my Linux PC at home download whatever file I tell it to, and that's it. Is this possible? I can't find any packages that allow this and I don't always have access/permission to use a telnet client. For example, I might be trying to do this from a tablet or smartphone, or my work PC which does not allow telnet/ssh sessions nor does it allow said software to be installed. This is why I can't just login SSH and use wget.

This would be very handy for when I find software or large files when I'm not home that I would like to download, and I can begin the download remotely so that it's done when I get home.

I'm using Kubuntu 15.10 64-bit.

  • Write a simple web page, that accepts a URL and writes it to a file in a directory. Run a separate script scheduled with cron to check for files in that directory, read the content of the file, and wget the URL, storing the output somewhere. Then, build a very secure authentication layer so that it doesn't get used to DOS someone. – EightBitTony Feb 19 '16 at 15:31
  • Or, set up a free e-mail account somewhere, use fetchmail and procmail to parse mails sent to the account and wget the URL's included in the body of the e-mail, and never tell anyone about the e-mail address. – EightBitTony Feb 19 '16 at 15:34
  • 1
    On your Linux server, you can install a package called Shell-In-A-Box. It is an ajax terminal emulator, accessible by loading a webpage on port 4200. It is not perfect. As a matter of fact it leaves a lot to be desired from a terminal emulator, but in a pinch, you can run a quick wget command to download whatever you want, while being away. – MelBurslan Feb 19 '16 at 15:38
  • You can just setup simple webpage which saves the URL to a file in particular folder. Then you setup simple bash script which parses the files and wget the files. Then with cron job you make this script to run every 10 minutes lets say. – Svetlin Tonchev Feb 19 '16 at 15:44
  • Also, this question is similar and has some suggestions which might help - unix.stackexchange.com/questions/136924/… – EightBitTony Feb 19 '16 at 15:50
1

Write a simple web page, which accepts a URL in a form field, and writes it to a new file in a known directory on the machine in question.

Then set up a job in cron to scan for new files in that directory, and wget the URL inside them. Make sure wget is running as a user with almost no access to anything other than the destination for the download itself.

You will need to add a strong authentication layer in front of this to prevent your machine being abused (DOSing targets, downloading illegal content, etc.)

If you're going to allow unfettered access from any location - you need to be very careful about what can be achieved.

0

Create an e-mail account somewhere which can be accessed via POP3 or IMAP (for example, gmail). On the machine you want to download the files, install fetchmail and procmail (or similar tools if you prefer them).

Configure fetchmail to download mail on a regular basis and deliver it to a known local user.

Configure procmail on that user's account to parse the e-mails, pull out any URL's and write them to files in a known directory.

Have cron schedule a script to read those files and kick off wget's.

I'm suggesting disconnecting the procmail script with the wget, so that procmail doesn't get tied up carrying out long running operations.

Then all you need to do is send mail to the target account with one URL per line.

Avoid revealing the e-mail address, so that it can't be abused by people sending hundreds of requests and DOSing you or some other target.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.