Hello,
Welcome to Linux! There are some things to learn, and you are in for a small challenge, but it is very well worth it, and you will be a happier fella for taking this step.
A FIRST MAJOR STEP you have already made -- you have realized that you should not be running around as the root user for normal day-to-day tasks. Only use Root when you need it. There are weeks that can go by that I have not used the root user operation... if you setup your system properly, and assign the rights correctly, you too can have a peaceful life.
If you are going to really migrate to Linux, you need to learn how to work in the Terminal, the Command Line Interface (CLI).
Look into the launcher bar there for the System Tools --> Terminal. If you are logged in as a normal user, here you can use the "su -" command to promote yourself to being a super-user. Security note: If you want only certain people to have this functionality on your public boxes, you can change the perms so that only a certain group of users can use this command. I have done this for 2+ years with no hiccups.
Ok, so you are in the terminal window. Time for a few commands:
cd Changes the directory
pwd Prints the path of the current directory
chmod Changes the permissions on a file
chown Changes the owner of a file
chgrp Changes the group of a file
ls Lists out the directory file names
ls -l Lists out the directory, in long view, showing permissions on files.
Let's look at some of my files here:
[christian@astro internet]$ pwd
/internet
[christian@astro internet]$ ls -l
total 36
drwxr-xr-x 5 apache apache 4096 Sep 3 17:47 egroupstore
drwxr-xr-x 5 root root 4096 Sep 9 00:43 ftp
drwx------ 2 root root 16384 Sep 2 14:13 lost+found
drwxr-xr-x 5 mysql mysql 4096 Sep 3 17:45 mysql
drwxr-xr-x 3 christian christian 4096 Sep 30 20:54 Temporary Items
drwxr-xr-x 5 root root 4096 Sep 2 14:36 www
You will see that I have made my own /internet partition outside of /var, and that it has different owner names and group.
Let's look at the www directory.
drwxr-xr-x 5 root root 4096 Sep 2 14:36 www
d means it is a directory.
The next three letters mean "Read Write eXecute" for the OWNER
The middle three letters are "Read no-thing eXecute" for the GROUP
The last three letters are "Read no-thing eXecute" for the WORLD (public).
If there is a - in the permissions location, that means the priv is revoked.
How do you set permissions? Using chmod *filename* or chmod *dirname*
If you are good with octal numbers, you can change them really easily.
Think of it as
R = 4
W= 2
X = 1
So, if you want RWX (all perms), then 4 + 2 + 1 = 7 (this is common for owner)
Others:
RWX = 7
RW- = 6
R-X = 5 (this is common, you can read, and execute the file, but no write/change)
R-- = 4 (not as common, as it can get funny if you can read but not run)
-WX = 3 (rare / weird)
-W- = 2 (Great for drop boxes... teachers set this up for students to drop homework)
--X = 1 (not as common)
--- = 0 (no access)
So, where are we going with this?
Each number place in the chmod x y z means x for owner, y for group, and z for world.
Your www directory might be
drwxr-xr-x 1 root root 220350 Sep 7 00:16 www
And this means that only the root user can write to the directory (meaning inside the directory) and your user would only be able to read and execute. You would need to do two things.
chmod 775 www
Do an ls -l to see what that did.
Then you need to
chown root.username www
where username is the username you are using to edit your files. Again, do an ls -l to see what you did. If this is a public box where a group of you will be saving information there, then create a groupname, and add yourself to the group, and then chown root.groupname directoryname instead.
You are in effect telling the system that the group of people you specified have permissions to write inside that directory. You left the last digit at 5, so that the outside world can only read the information inside their web browser.
There is another way to do the permissions involving "chmod o=+r-x" and that style... I find the numbers to be much easier. Learn the numbers the first time, and you will be an educated Linux user!
If you need more information, please ask. This post may be long/windy due to the hour.
Christian