Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.