LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Why is it unsafe to browse the web as root? (https://www.linuxquestions.org/questions/linux-newbie-8/why-is-it-unsafe-to-browse-the-web-as-root-438014/)

gregorian 04-23-2006 09:58 AM

Why is it unsafe to browse the web as root?
 
A lot of people online advised me to never browse the web as root.I can understand why you must not work as root for doing day to day tasks as it is really easy to mess the sytem files up.But would somebody mind explaining what harm could merely browsing the web do?

Also I wish to know why is it unsafe creating a file beginning with ' . '
in the current directory.I thought ' . ' only makes a file hidden.

Thanks a lot for your help.

ataraxia 04-23-2006 10:33 AM

Quote:

Originally Posted by gregorian
A lot of people online advised me to never browse the web as root.I can understand why you must not work as root for doing day to day tasks as it is really easy to mess the sytem files up.But would somebody mind explaining what harm could merely browsing the web do?

If you go to a page that has some nasty script on it, that breaks into your browser, it can do anything you can do. So, if you browse as root, it can do anything to your machine. If you browse as non-root, it can only mess up your personal stuff, but not break the system.
Quote:

Originally Posted by gregorian
Also I wish to know why is it unsafe creating a file beginning with ' . '
in the current directory.I thought ' . ' only makes a file hidden.

It's not unsafe, as far as I know. I think somebody told you wrong ;)

reddazz 04-23-2006 10:42 AM

While running as root, if there are any security flaws in the apps you are running, outsiders can use those to gain access to your system. Sometimes Unix security measures seem to be a bit paranoid, but its always for a reason.

seandon4 04-23-2006 10:44 AM

Hello. Doing anything as root for day-to-day things is risky. One slip and you could accidentally delete or overwrite a wad of important files and not easily know how to get them back. Web browsers can execute scripts which have the potential to do things to files on your PC, though, admittedly, this is unlikely unless security is broken (if someone has found an exploit.) For example, the same risk exists in Outlook in Windows, which can execute scripts from Spam messages without you knowing it. Causing spyware, etc.

Never heard of '.' (hidden) files being unsecure.

gregorian 04-23-2006 11:12 AM

Here is the exact text:

How to keep from accidenatlly running a Trojan in your shell account. Damian advises "NEVER put '.' (the current working directory or cwd) in your path! If you really want "." in your path, make sure it is the last one. Then, if a Trojan like ls is in your current directory, the _real_ ls will be used first. Set your umask (umask is the command that automatically set permissions on all files you create, unless you specify otherwise) to something more secure than 022, I personally use 077. Never give group or other write access to your directory and be leery of what others can read." For your reading enjoyment, use the commands "man chmod" and "man umask" to get all the gory details.

reddazz 04-23-2006 11:21 AM

That text does not mean that there is a problem with hidden (dot) files. Its pretty self explanatory in my opinion.

gregorian 04-23-2006 11:44 AM

Iam a newbie user but I understood that chmod and umask part.But what do you mean by not putting ' . ' in your path and how does it affect you.

If possible kindly illustrate with an example.

mcmillan 04-23-2006 02:26 PM

Your path is all the directories that can be used will execute files by just typing the file name instead of the whole location. For example, say I have a script in my home folder I want to execute. Without the home folder in the path you have to type ~/myscript. If it's in the path you can just type myscript. Using the period is a shortcut for what ever the current directory is. I can see that adding "." to your path could be a risk, because then some malicious code could get executed easily if it got installed. Otherwise it would have to know the location on your system. In case you want to know what your path is you can type echo $PATH. Also some other directory shortcuts that my be useful in case you don't know are ~ which I already mentioned is your home directory and .. is the directory above the current one.

gregorian 04-24-2006 01:50 AM

Ok Now I get it thanks for your help.


All times are GMT -5. The time now is 09:55 AM.