PDA

View Full Version : Permission problem!



toolz
05-15-2008, 09:22 AM
Hello,

I think I messed up things with a command..

I've just did chmod -R 770 /home/*
and chown -R 770 /home/*

When I did that users site were not available and they couldnt do anything

Now I had to do chmod -R 775 /home/*
to allow users edit and do what they do

But thats a problem, all users can do that even in other users dirs..

Is there anyone who can tell me to fix things up as they were before by default? at directadmin setup?

Thanks!

jlandes
05-15-2008, 10:41 AM
What you did was not very good at all. Here's a script that you might be able to use to fix the issue, but please keep in mind that I have not tested it so use at your own risk.

Create a file called fix_dirs.sh and chmod it to 755. Place the following code in the file:


#!/bin/sh
for i in `ls /usr/local/directadmin/data/users`; do
{
chown -R $i:$i /home/${i}
chmod -R 755 /home/${i}
};
done;
exit 0;

Then run it via the command:


./fix_dirs.sh

Another option is to contact DirectAdmin support and have them help you fix the issue. Good luck! :)

toolz
05-15-2008, 10:57 AM
Thanks for you reply,

Seems to be working.. I mean I don't see a problem with the accounts!

Its just something which I am not sure about, leaving 755 wouldn't that let anyone execute on someone's files? If so don't know if thats good?

I tryed executing other user's file and I was able... how do I fix that?

jlandes
05-15-2008, 11:30 AM
Directories should be 755 and files should be 644. I guess I forgot that in my script. :(

toolz
05-15-2008, 11:52 AM
And with the above script you've told me can that be done? What changes should the script contain to do 644 on files?

Thanks again!

nobaloney
05-15-2008, 06:33 PM
Check your /usr/local/directadmin/scripts directory for a script to set permissions.

Run it.

Jeff

jlandes
05-15-2008, 06:38 PM
Try this at the command prompt. DirectAdmin already has a tool for this:


cd /usr/local/directadmin/scripts
./set_permissions.sh user_homes

If that doesn't work, try this from the same directory:


./set_permissions.sh all

Let us know if this works.

jlandes
05-15-2008, 06:40 PM
Check your /usr/local/directadmin/scripts directory for a script to set permissions.

Run it.

Jeff
Thanks Jeff. I forgot about this script. Sure would be nice to have some good docs, but that's another story I won't go into here. :)

toolz
05-16-2008, 03:33 AM
Thank you, that helped.