I have SSH access to a Centos 7 virtual machine. I wanted to change the permissions on the apache folder (var/www) on my user in order to edit the files remotely, but I erroneously performed chown -R <user> /var/
. Now I cannot SSH anymore. How can I solve this problem? What could be the reason?
EDIT: I don't have access to the physical machine that hosts the virtual machine
Add a comment
|
1 Answer
rpm --setugids openssh-server
You may also need to restart the service
-
-
On the machine you performed the accidental
chown -R
, yes. Since you cannot SSH into the system, this will probably require accessing the console of the VM. If you don't have console access to your VM, you may need to contact the administrator of the physical host.– telcoMFeb 10, 2018 at 19:47 -
What is the difference between this command and giving back the permissions with
chown -R root /var/
?– firionFeb 12, 2018 at 9:00 -
@Francesco: if root is the rightful owner of the files, then what is preventing root from reading and writing them?– symcbeanFeb 12, 2018 at 23:05