chmod directories???
Complete Newbular here!
Anyways, just started using ol' Debian Sarge, love it! My question is this: I had set up all files in my root directory instead of as a user until someone kindly informed me this was very bad form. So I moved all my files over to user. Now I am having permissions issues everytime I try to save a file. Do I have to go into the files and chmod every single one of them, or is there a way to set blanket permissions for the lot? Thanks! |
Change ownership of all the files from root to yourself using chown e.g. to change ownership of all files is a directory called dir in your home directory do
Code:
#chown -R user:group /home/user/files/ |
user:group
how do i define group? |
Quote:
|
ok, here is what i entered and here is what it yielded:
john:/home/john/john# id -u 0 john:/home/john/john# id -u john 1000 john:/home/john/john# id -G 0 not sure how to interperet 0 and 1000 |
What are the results or running "id" without any other options. -u would be your username and -g would be your primary group. -G is for other groups.
|
john:/home/john/john# id
uid=0(root) gid=0(root) groups=0(root) |
ran # chown -R john:0 /home/john/john
seemed to do the trick! thanks |
Why are you using the root group as your primary group? This is something that should be avoided if possible because of security reasons and because you can do damage to your own system if you have access to stuff that should belong to root only. I think in Debian you should use a group thats similar to your own name or use the users group.
|
How would I go about changing that?
|
Typically the system creates a group with the same name as the user...
I would think this would be more correct for a users home directory.. # chown -R john:john /home/john/john When logged in as your user you can simply type the command groups username to see what groups the user belongs to.. Quote:
john should NOT be a member of the group root.. |
Check if there is a group that matches the users username in /etc/group. If there is, run "usermod -g group user". If the groupd does not exist, create it before running usermod.
|
Created groups "users" and added john
here is the output: john:/home/john# groups john john : users dialout cdrom floppy audio video plugdev what next? |
As long as you have changed the primary group for john to users (usermod -g users john), then thats it.
|
Thank y'all very much! It is shocking the difference in level of support for Linux and Microsoft.
|
All times are GMT -5. The time now is 09:29 PM. |