Home  >  Article  >  Backend Development  >  chown -R www.www /

chown -R www.www /

WBOY
WBOYOriginal
2016-06-23 13:33:484278browse

用git push之后,再拉到网站目录写错了,chown -R www.www  /,之后再运行chown -R root.root  /,然后许多服务不能运行了。
之后叫人帮我改了服务的所有者和所有组,表面上看上去好了。
现在怎么尽可能的修复这个坑?


回复讨论(解决方案)

chown -R www:www /home/wwwroot/default
/home/wwwroot/default是你的网站目录

chown -R root.root  /
你这样把所有文件都改为了root的权限才能执行,可能导致其它用户权限不能运行自己的服务,找到一个改一个把,如mysql,nginx

chown -R www:www /home/wwwroot/default
/home/wwwroot/default是你的网站目录

chown -R root.root  /
你这样把所有文件都改为了root的权限才能执行,可能导致其它用户权限不能运行自己的服务,找到一个改一个把,如mysql,nginx


这样会不会导致开不了机?

应该不会,其实也没那么严重,遇到那么服务不能运行,就看改一下所有者就行了,应该也不是很多

将目录设置为,www账户可读权限呢

把文件的所属组 所属用户 改成 和执行nginx php 的用户相同 即可。试用root执行就是个吭。安全隐患太大

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn