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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Ok. So I was trying to learn mysql and the book I was reading requires me to do a: 'chown -R root .' apparently upon doing that, I realized that the configurations for the current user that i was logged into shows a few erratic behaviour, particularly with the desktop background being lost and areas unaccessible etc. etc. Of course I knew right away that it was a permission problem. Now what I did was to chown -R [user] again to revert temporarily ( I know it's not the best solution but I'll get back to that later). Now I want to correct it but I don't know what syntax should be used with 'chown' that excludes the /home/user when changing the root directory to 'root'. i have browsed through the man pages and i can't find such syntax. or am i just confused? i hope anyone can help. thank you very much.
The -R option to chown is recursive from where you executed it, and you can't omit directories by name AFAIK (see --from info below). If the argument is ".", as you said, it depends which directory you executed it from because "." means "the current working directory".
There is the option --from=CURRENT_OWNER:CURRENT_GROUP, which only changes ownership where the old owner and group are as specified, which might help.
Other than that, you could use the find command to list all the file you want, and then use xargs to change the ownership. Find gives excellent possibilities to make complex rules about what you want to include/omit.
Ok. I guess I misunderstood what the '.' means. I thought it was root directory and its subfolders. I'll keep that answer at bay just in case it came in handy. For the meantime, I'll resume my mysql studies. Thank you very much.
hmm. what's the default permission settings for most of the common (or shared if you wish) locations such as /tmp which is used by most users. I think i did a mistake by entering chown -R root . on the root directory. Now, i am reverting it back to its original permissions.
chown root:lock lock
when you are in /var, and similarly for named.
HOWEVER, if you did that original chown -R from the system root dir ie '/', then to be honest, I'd seriously consider a re-install, because you will have changed hundreds if not thousands of dirs/files (ie the entire system) and it's not worth trying to straighten it out manually.
There'll always be one you missed and strange failures will occur.
It's your choice of course.
There may be some tool for re-setting ownership of all the system files/directories. I vague remember something like that with SuSE ages and ages ago which would set the permissions and ownership according to some security policy (there was a strict one, and a relaxed one). I don't remember the name though.
Tracking it down and working out how to run it may well be more of a pain than just re-installing though.