how to change back all folder in 777 to 755 and file in 777 to 644

seachen

Verified User
Joined
Feb 3, 2007
Messages
491
previous my server have no suphp.

i just install it into my server.

now i need to change my user website which have using folder permission 777 to 755.

if not the website cant run.

may i know any short cut which can make faster because i got few hundred website to do 1 by 1 . it taking long time.
 
Last edited:
cd /usr/local/directadmin/scripts && ./set_permissions.sh user_homes
find /home/*/domains/*/public_html -type d -print0 | xargs -0 chmod 711
find /home/*/domains/*/public_html -type f -print0 | xargs -0 chmod 644
cd /usr/local/directadmin/data/users && for i in `ls`; do { chown -R $i:$i /home/$i/domains/*/public_html;}; done;
(last line is all on one line)
 
Hi,

Let said username is ckopi, domain name is ckopi.net

how to replace at the below code:

cd /usr/local/directadmin/scripts && ./set_permissions.sh user_homes
find /home/*/domains/*/public_html -type d -print0 | xargs -0 chmod 711
find /home/*/domains/*/public_html -type f -print0 | xargs -0 chmod 644
cd /usr/local/directadmin/data/users && for i in `ls`; do { chown -R $i:$i /home/$i/domains/*/public_html;}; done;
 
The code I, well, we, pasted will affect all users and their domains, which will ensure every domain will work.

You can however do, for ckopi:
Code:
find /home/ckopi/domains/ckopi.net/public_html -type d -print0 | xargs -0 chmod 711
find /home/ckopi/domains/ckopi.net/public_html -type f -print0 | xargs -0 chmod 644
chown -R ckopi:ckopi /home/ckopi/domains/ckopi.net/public_html
 
find /home/ckopi/domains/ckopi.net/public_html -type d -exec chmod 711 {} \;
find /home/ckopi/domains/ckopi.net/public_html -type f -exec chmod 644 {} \;
chown -R ckopi:ckopi /home/ckopi/domains/ckopi.net/public_html
 
error 404 in mi page

i have that problem i dont know how to fix et can u help me
i oready have all the html file up i dont know what more to do

send me to mi hotmail a enser pliss

[email protected]
 
If you have access to root, just execute the shown steps (not the ones with ckopi), or contact your hosting provider for help.
 
hi.

thanks for your cmd that you provided.

i just migrate another server without suphp to a server with php.

now i need to follow the cmd that you provided 1 by 1.

any cmd that can 1 times fix all the permission and reset ownership?
 
do you mean just paste code below?

cd /usr/local/directadmin/scripts && ./set_permissions.sh user_homes
find /home/*/domains/*/public_html -type d -print0 | xargs -0 chmod 711
find /home/*/domains/*/public_html -type f -print0 | xargs -0 chmod 644
cd /usr/local/directadmin/data/users && for i in `ls`; do { chown -R $i:$i /home/$i/domains/*/public_html;}; done;

am i need to change any word? or just paste it? worry. haha.
 
@seachen,

What is your output for

Code:
# /usr/local/directadmin/directadmin c | grep secure_access_group

???
 
Back
Top