When I often execute a chown command in Linux I always put the owner and the group the same. Like this for example:
当我经常在Linux中执行chown命令时,我总是把所有者和组一样。像这样例如:
chown [OPTION]... [OWNER][:[GROUP]] FILE...
chown justin:justin file.txt
What is the difference exactly and what security measures should I be aware of? I typically use this in a web hosting server to set all files owned by the desired user, under a Fast CGI PHP handler.
有什么区别,我应该注意哪些安全措施?我通常在Web托管服务器中使用它来设置所需用户拥有的所有文件,在快速CGI PHP处理程序下。
1 个解决方案
#1
For each file, the user, group and public each could basically read, write or execute a file or directory. If you and I both log in to the same system and need write access to the same files, we could be both put in the same group, and write access be given to that group.
对于每个文件,用户,组和公共每个文件基本上可以读取,写入或执行文件或目录。如果您和我都登录到同一系统并需要对相同文件的写访问权限,我们可以将它们放在同一个组中,并且可以对该组进行写访问。
For certain software (Symfony for example), the user who owns the files must be in the same group as the user who runs the web server for some functionality to work. Generally, though, it's a good idea to keep things as isolated as possible.
对于某些软件(例如Symfony),拥有这些文件的用户必须与运行Web服务器的用户位于同一组中才能使用某些功能。但一般来说,尽可能保持隔离是个好主意。
#1
For each file, the user, group and public each could basically read, write or execute a file or directory. If you and I both log in to the same system and need write access to the same files, we could be both put in the same group, and write access be given to that group.
对于每个文件,用户,组和公共每个文件基本上可以读取,写入或执行文件或目录。如果您和我都登录到同一系统并需要对相同文件的写访问权限,我们可以将它们放在同一个组中,并且可以对该组进行写访问。
For certain software (Symfony for example), the user who owns the files must be in the same group as the user who runs the web server for some functionality to work. Generally, though, it's a good idea to keep things as isolated as possible.
对于某些软件(例如Symfony),拥有这些文件的用户必须与运行Web服务器的用户位于同一组中才能使用某些功能。但一般来说,尽可能保持隔离是个好主意。