Jump to content
xisto Community
MGM

Easy Downloading Command For Linux (newbies)

Recommended Posts

How to download files and make your computer shutoff...

 

Open up a cosole... login as root

i.e.

depending on your distro

su root
Then enter your password

now cd to where you want your downloads to be in...

cd /home/user
or where ever you want your files

 

Then get the downloads urls you want and type this is console

wget [url="http://forums.xisto.com/no_longer_exists/; 1 && wget [url="http://anotherone.com/rg-erdr.php?_rpo=t; && poweroff
Then press enter

 

And you can leave your computer running knowing that it will turnoff when your done!

 

--- Make sure you have the wget package installed!

Share this post


Link to post
Share on other sites

No !!!!!
No No No No No....
NOOOOOOOOOOOOOOO.

This is a security problem.

wget does NOT need root privilages to download files to your home directory.
any bugs in wget that allow arbitary code to run would run as root.

as a normal user, the damage an attacker can do is limited.. as root, an attacker could install root kits and other nasties !


The correct thing to do, would be to set SUID on /sbin/shutdown, and as a NORMAL user..

wget whatever; shutdown -h now

or setup sudo to allow normal users to run shutdown as root and use
wget whatever; sudo shutdown -h now

ALSO.... use of the '&&' would prevent the machine from shuting down if the download fails (think of the electiricity bill)
use ';' so that the shutdown will run whenever wget exits (even with EXIT_FAILURE)

Also, maybe pipe wget stdout so that you can confirm that the download finished succesfully when you reboot.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.