Permission problem!

toolz

Verified User
Joined
Apr 9, 2008
Messages
21
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!
 
Last edited:
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:

Code:
#!/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:

Code:
./fix_dirs.sh

Another option is to contact DirectAdmin support and have them help you fix the issue. Good luck! :)
 
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?
 
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!
 
Check your /usr/local/directadmin/scripts directory for a script to set permissions.

Run it.

Jeff
 
Try this at the command prompt. DirectAdmin already has a tool for this:

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

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

Code:
./set_permissions.sh all

Let us know if this works.
 
Back
Top