Author Topic: Fix permissions  (Read 1162 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Fix permissions
« on: May 11, 2023, 02:14:41 PM »
So i was fixing some permissions on a folder and i typed / instead of ./  :(

Sad short story ;D.

The good thing is that i did this before like any amateur so i called my vps host i asked for safe mode to copy files to my machine which they didn't have  ;D

I went to sleep that night and woke up with mindset to fix the permissions one by one ! I did it in day 3 my vps started working again.

The server security is inexistant, so many bugs specially on mysql.. i know it's impossible to recover the permissions to perfection..

Is there a way to backup --> fresh install --> restore websites ? or reinstall without losing websites ? or any other way  :(

PS: i have access to other cwp machines.

We're in production here :D using free cwp.


Offline
*****
Re: Fix permissions
« Reply #1 on: May 12, 2023, 01:48:51 PM »
Well, obviously I've never tried this, but you could try it...
Boot off of a rescue image or bootable USB stick. Mount your drive and run these commands:
Code: [Select]
chmod 0700 -R /root/.ssh
chown root -R /
chmod 755 -R /
Reboot the system normally, login as root and run this to reset permissions:
Code: [Select]
for p in $(rpm -qa); do rpm --setperms $p; done
for p in $(rpm -qa); do rpm --setugids $p; done
Good luck!

Offline
*
Re: Fix permissions
« Reply #2 on: May 20, 2023, 03:21:32 PM »
So i was fixing some permissions on a folder and i typed / instead of ./  :(

Sad short story ;D.

The good thing is that i did this before like any amateur so i called my vps host i asked for safe mode to copy files to my machine which they didn't have  ;D

I went to sleep that night and woke up with mindset to fix the permissions one by one ! I did it in day 3 my vps started working again.

The server security is inexistant, so many bugs specially on mysql.. i know it's impossible to recover the permissions to perfection..

Is there a way to backup --> fresh install --> restore websites ? or reinstall without losing websites ? or any other way  :(

PS: i have access to other cwp machines.

We're in production here :D using free cwp.

Yes you can create a full backup to your website via "Account backups " Save the backup to your local machine and then restore aftere fresh install.