Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Easy Downloading Command For Linux (newbies)
MGM
post Nov 15 2007, 03:51 AM
Post #1


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 4
Joined: 14-November 07
Member No.: 26,160



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

Open up a cosole... login as root
i.e.
depending on your distro
CODE
su root

Then enter your password
now cd to where you want your downloads to be in...
CODE
cd /home/user

or where ever you want your files

Then get the downloads urls you want and type this is console
CODE
wget http://thewegsite 1 && wget http://anotherone.com && 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!

Go to the top of the page
 
+Quote Post
yordan
post Nov 21 2007, 08:56 AM
Post #2


Way Out Of Control - You need a life :)
Group Icon

Group: [MODERATOR]
Posts: 1,980
Joined: 16-August 05
Member No.: 7,896



is "poweroff" safe ? I don't know this command. Does poweroff sync the filesystem cache ?
I usually don't use poweroff, I "shutdown -g 0 -h"
Go to the top of the page
 
+Quote Post
qwijibow
post Nov 30 2007, 05:32 PM
Post #3


Way Out Of Control - You need a life :)
Group Icon

Group: Members
Posts: 1,366
Joined: 14-September 04
From: Nottingham England
Member No.: 570



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..

CODE
wget whatever; shutdown -h now


or setup sudo to allow normal users to run shutdown as root and use
CODE
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.

Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Hotkeys / Keyboard Quick Launch Keys In Linux(5)
  2. Command Line (dos) Tips For Windows Xp(5)
  3. What Language Is Linux Written In ?(15)
  4. Command Prompt Tips(1)
  5. Dynamically Change The Background Image On Mouse Effects!(3)
  6. Prove To Me That Linux Is Better (For Gaming)(21)
  7. What Made You Switch To Linux?(60)
  8. Need To Hack An Admin Account On Xp... No Problem!(61)
  9. So Many Kinds Of Linux, Which Will You Choose?(24)
  10. Psybnc - Howto(4)
  11. Could Linux Become The Dominant Os?(12)
  12. Looking For Linux(34)
  13. Access(17)
  14. How To Create Your Own Proxy Site (free And Easy)(13)
  15. Diablo 2 In Linux?(10)
  1. My Review And Experiance Of Ubuntu Linux(4)
  2. How To Install Linux Suse(1)
  3. How To Play Music And Movie In Linux? Which Is The Good One?.(3)
  4. How To Copy File & Folders From Linux To Windows?.(12)
  5. Linux For Beginners- Easy To Install(10)
  6. Pause A Command Prompt After Execution?(5)
  7. Gimp Userbar Tutorial(3)
  8. Choice Of Motherboard For Linux Virtualization(4)
  9. Any Mobile That Run On Linux Os?(3)
  10. Why Linux?(23)
  11. How To Find Ftp's The Easy Way'(1)
  12. Which Linux Version For Newbies?(10)
  13. [c/c++][linux] Linking With A -l Is Static Or Dynamic?(0)


 



- Lo-Fi Version Time is now: 30th August 2008 - 02:12 PM