PDA

View Full Version : Setting permissions is this the right method?



tech291083
17th September 2006, 02:37 PM
i m running fedora 5. in order to set permission for the /var folder what i did was 1st starting a terminal and then typing 'su' entering the root password and then typing 'konqueror' and pressing enter. the konqueror window opened. i kept the terminal window opened and then typed /var/www and moved into the folder i wanted. i tried to set the permissions for the user and group but came an error message '/var/www'. did i do any thing wrong in terms of trying to set the permission for the folder? please let me know i am really trying my best but getting no where.thanks.

pparks1
17th September 2006, 02:55 PM
What exactly was the command that you typed to set permissions?

Usually you set file ownership with

chown user:group /directory_or_filename

Usually you set permissions with

chmod ### /directory_or_filename

tech291083
17th September 2006, 03:08 PM
hi

thanks for the reply actually i did not type any command as you have suggested but i tried to set the permissions using the dialog box by right click and opening it. what i want actually is the owner of the directory is root but i want it to be able to viewed and modified by other users and group. can you please guide me i m totaly new to linux. thanks.

u-noneinc-s
17th September 2006, 09:46 PM
It's probably not wise to have /var writable by others than the inteded file/directory owners. Pretty much everyone should have read permissions for most of /var, but say /var/spool is accessible and readable, but not much of anything below that is or should be readable by others (cron cups mqueue etc).

tech291083
18th September 2006, 10:48 AM
hi,
you seem to be right actually i am totally new to linux and that is why being idiot. since i am the only one using my pc i want to make all the files and directories avaialble to root and the regular user both at the same time. but you have given me the right hint. thanks a lot again.

robatino
18th September 2006, 11:00 AM
That's a bad idea. One reason why certain files/directories are read/write protected from ordinary users is to prevent user mistakes from breaking things. You're better off leaving the permissions as they are and su'ing to root when you need access to them, which shouldn't be often. As a rule, the permissions are chosen carefully to give ordinary users as much access as they can safely have. Also keep in mind that these root-owned files/directories are usually owned by some package in the RPM database, and by making these changes the database and actual filesystem can get out of sync.

paul matthijsse
18th September 2006, 08:30 PM
I fully agree with robatino. Tech291083 (is that your birthday btw? :-), in Linux a user account is not a restricted account for stupid users. It gives you nearly full access to the system, but a user can only mess up or break his or her own account, or delete his/her own files -- but not other's. Root can mess up or break the whole machine, or delete every file on the machine. So if you are root, you really _must_ think twice before giving certain, perhaps "dangerous", commands. Stated otherwise, as root you must be 100% sure of what you are doing. If not, you'll encounter problems quite soon (*really* quite soon!).

If you don't believe me, log in as root and explore the file system and say, hey, I can free up some disk space by removing those big old log files that I never heard of or removing some dirs that I don't need. Really a shortcut to mess up your system!

Way cooler to be a "simple" user! :-)

Cheers, Paul.