How to fix root permissions in Centos 7?

General support questions
Post Reply
sohum
Posts: 1
Joined: 2021/12/04 21:09:51

How to fix root permissions in Centos 7?

Post by sohum » 2021/12/04 21:19:26

Hi,

I changed by mistake the root permissions of my server (Centos7/Vestacp/IONOS) as showed in the picture (https://drive.google.com/file/d/1-7sWER ... sp=sharing).

For this reason, I am unable to connect via SSH and my vesta panel login is unavailable.

The root login works only via KVM console. My sites are still working well.

How can I restore my default root permissions (i.e., set the right root permissions again)?

Thanks

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: How to fix root permissions in Centos 7?

Post by jlehtone » 2021/12/05 10:36:28

There is at least yum reinstall

sml
Posts: 305
Joined: 2020/01/17 09:01:44

Re: How to fix root permissions in Centos 7?

Post by sml » 2021/12/05 12:13:48

rpm --restore -a will do as well.

pjsr2
Posts: 614
Joined: 2014/03/27 20:11:07

Re: How to fix root permissions in Centos 7?

Post by pjsr2 » 2021/12/06 15:30:06

To reset user/group ownership of files in all packages:

Code: Select all

for p in $(rpm -qa); do rpm --setugids $p; done
To reset permissions of files in all packages:

Code: Select all

for p in $(rpm -qa); do rpm --setperms $p; done

Post Reply