How to delete .htaccess file with permission 0444

Viewed 33

How we can do the same in FTP as server is not VPS. I have lots of .htaccess infected file in the server with permission(0444), i have to delete those file one by one and there are thousands of files. Please help me.

1 Answers

You can do it with the command line if you have ssh access and you're good at using the command line.

You can know the commands here https://www.cyberciti.biz/faq/linux-unix-how-to-find-and-remove-files/

NOTE: If you're not good with command lines then don't run anything directly on the server, practice in localhost then use in live server

Also, Make a full backup before doing anything

You can follow these steps if you don't have SSH access.

  1. download the fresh zip of wordpress and extract it then delete the wp-content dir from that extracted zip.
  2. renamed wp-admin and wp-includes to wp-admin-new & wp-includes-new
  3. then upload both folders to your server and rest replace the files wp-load.php, index.php, etc to your server.
  4. then rename wp-admin and wp-includes(old ones) to wp-admin-bk & wp-includes-bk
  5. then renamed wp-admin-new & wp-includes-new to wp-admin and wp-includes
  6. Delete wp-admin-bk & wp-includes-bk folders.

Now your core files are clean, now follow these.

  1. connect your FTP server using any FTP client. I am assuming you're using FileZilla
  2. Goto wp-content folder then select, themes folder right click choose file permissions
  3. set 664, check recursive into subdirectories, then choose to apply to files only.
  4. repeat the same for the uploads and plugins folder.

Now you can scan again with WordFence and should be able to delete those files.

Related