Change change mode of all files and folders in CPanel at once?
Asked Answered
A

4

5

I have a deluxe hosting with GoDaddy and have uploaded WordPress websites in it. However, nowadays someone is hacking into my website (even after changing the cpanel and ftp passwords) and uploading files which include a zip file, and after they extract the zip file it will have N number of files as a result my hosting resource is getting overflown.

I keep on deleting the files and reuploading a fresh copy but they again do the same. Since it's WordPress I have to change permission of a number of folders which is impossible. Please guide me about how to change the permission at once. I also tried FileZilla to change permission but it's shown to be changed in FileZilla and when I check back with CPanel file manager, it's still the same permission.

Achaemenid answered 23/3, 2016 at 5:19 Comment(0)
J
6

You can simply use File Zilla and log in with your cPanel credentials. When you right-click, there is an option for file permission; Inside this option, you will find Recursive File & Folder Permissions! Voila.. Job Done!

Julijulia answered 7/5, 2021 at 10:26 Comment(1)
It takes forever if you're doing a lot of file/folders recursively though.Dammar
H
1

You can not change all files and directory permission recursively through cPanel, if you have shall access of your account then you can change it through SSH, Otherwise you need to contact your hosting provider to update it.

Also, I will suggest you please remove your all files from public_html directory and upload all fresh files, Might be there is shell scripts present in your account and due to you are facing this issues.

Once you upload your files, Please secure your word-press with the following steps.

http://codex.wordpress.org/Hardening_WordPress

Hesper answered 23/3, 2016 at 11:53 Comment(0)
A
0

Sites that give cpanel access typically give ftp access. You can use lftp the smart ftp client to do the job. I did brew install lftp in my macbook then use the following snippet to change the file permission:

lftp <<EOF
set ftp:ssl-allow no
set ftp:passive-mode true
set ftp:list-options -a
open -u xxx,yyy zzz.host.com
chmod -R 0777 /public_html/concrete575/application/files/
EOF

where xxx is my username, yyy is my password, and zzz.host.com is the ftp host.

Ammadis answered 12/2, 2018 at 20:25 Comment(0)
P
0

In my case, I managed to get it done by uploading a simple recursive PHP script to change permissions to all files within the desired directory.

Platyhelminth answered 10/6, 2020 at 4:30 Comment(2)
Please share the code.Anson
@Tayyebi, sorry it's been too long and I lost that bit of code by now. However, I found this similar question that you may find helpful: #9263122Platyhelminth

© 2022 - 2024 — McMap. All rights reserved.