LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Ubuntu 8.10 and want to download 2 GB file in command line. (https://www.linuxquestions.org/questions/linux-newbie-8/ubuntu-8-10-and-want-to-download-2-gb-file-in-command-line-717028/)

chandan766 04-05-2009 03:29 PM

Ubuntu 8.10 and want to download 2 GB file in command line.
 
Hi all,
I m running Ubuntu 8.10. I want to download 2GB file logging in as root in GUI, because another user's home directory has only 8GB space which is full. And it does not allow me to save file anywhere else as root is the owner of every other directory except /home/user1(which is full)
Would it be fine if i login as root in gui, connect to internet and download huge data?
Thanks

repo 04-05-2009 03:31 PM

why don't you login as user, open a terminal, become root, go to the directory where you want to safe the file and use wget

i92guboj 04-05-2009 04:24 PM

There shouldn't be any problem if you are going to use only wget. However, you could also create a temporal directory in a place where there's space, give the user permissions over it and use your regular user to download the file.

Code:

su
Password: # type your root password
mkdir /downloads
# this will grant permissions for ALL the users
chmod 777 /downloads
exit
# now you are a normal user again
cd /downloads
wget http://whatever

You can stop the download with control+c, and resume it using wget -c http://whatever

chandan766 04-05-2009 05:17 PM

thanks for reply....but when i use wget , it just saves something to get_form and no download starts.


please help.....

i92guboj 04-05-2009 05:33 PM

That url doesn't point to any real file. It runs a php script with some arguments, and I can't even enter it because it will redirect me to an error page. You would need to use a real url pointing to the file you want to download.

PS. You could try a text browser, like elinks or w3m. They should be safe to use as root as long as you don't enable javascript (I don't remember if they support such thing anyway).

chandan766 04-05-2009 10:13 PM

Thanks but i have to supply first my credentials , only then i can proceed to download and the link i talked about is the only link to download. Is it not safe to login as a root from gui and download and save the file where i want? Is it not safe to download through GUI at all?
Thanks.

i92guboj 04-05-2009 10:21 PM

There's absolutely no need to login as root. Just login as a regular user, then open a terminal and use su to become root, or sudo to launch your browser as root.

chandan766 04-05-2009 10:58 PM

after i opened the terminal and become root,,,,what should be next step? I m kinda new to this Linux.

i92guboj 04-05-2009 11:12 PM

Quote:

Originally Posted by chandan766 (Post 3499610)
after i opened the terminal and become root,,,,what should be next step? I m kinda new to this Linux.

Just launch your preferred browser, for example firefox, opera or whatever. Usually just typing its name and pressing enter.

chandan766 04-05-2009 11:18 PM

Thanks a lot.....I just followed alll ur steps about terminal and launching the firefox.....thanks a tonne. Is this equivalent to downloading as another user? Also is there any security threat as I have not installed antivirus on Linux?

i92guboj 04-05-2009 11:26 PM

Quote:

Originally Posted by chandan766 (Post 3499623)
Thanks a lot.....I just followed alll ur steps about terminal and launching the firefox.....thanks a tonne. Is this equivalent to downloading as another user? Also is there any security threat as I have not installed antivirus on Linux?

Well, when you use su or sudo, you efectively become root, with all that that implies. Running as root should be limited only to strictly needed situations. I would still use the method I suggested you above: create a directory that all the users can write into, and then download using firefox or whatever.

If you are responsible enough and your software is up to date nothing bad should happen. Still, the more complex software you run as root the more risk of hitting a vulnerability or a fatal bug. Think that when you run firefox as root, any javascript you run is also run as root. That means that any casual attack coming from a javascript snippet running in firefox has god-like powers over your system. Just like crappy ActiveX under windows, and you can imagine what does that mean.

Antiviruses and firewalls can't help with that, here or in windows.

That's why it's usually not recommended to run GUI stuff as root. Text programs are simpler and less likely to expose your system to a casual attacker.

chandan766 04-06-2009 09:27 AM

I created directory and have given permissions to all. Now am logged in as a user in GUI and downloading all the files into that directory which i created.
Thanks a lot but,, you were of great help.....

malekmustaq 04-06-2009 09:37 AM

=quote=
Now am logged in as a user in GUI and downloading all the files into that directory which i created.
Thanks a lot but,, you were of great help.....
=endquote=

chandan766:

A better way of complimenting a helpful senior member is to click the "thumbs-up" button at the lower right. :)

malek


All times are GMT -5. The time now is 09:49 PM.