对下载文件执行权限 [英] Execute permissions on downloaded file

查看:95
本文介绍了对下载文件执行权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了用于安装控制面板的脚本。
我已将该脚本上传到服务器,以便人们可以将其获取到他们的计算机中。
唯一的问题是下载后必须对其进行chmod修改。有没有办法删除此步骤?我该如何在已下载的脚本上保留755个权限?

I have made a script for installing a control panel. I've uploaded the script to a server so people can wget it to their machines. The only issue is that you have to chmod it after download. Is there a way to remove this step? How would I go about keeping 755 perms on the downloaded script?

推荐答案

当用户下载文件时,文件将自动获得一些默认权限。在UNIX中,每个用户将具有一组默认权限,这些权限适用于该用户创建的所有文件,除非您明确将其设置为其他权限。

When a user downloads the file, the file will automatically get some default permission. In UNIX, each user will have a default set of permissions which apply to all files created by that user, unless you explicitly set it to something else.

此默认值在用于更改命令的命令后称为 umask 。它可以从登录过程中继承,也可以在配置单个帐户的 .shrc .login 文件中进行设置,或者可以手动运行。

This default is called the umask, after the command used to change it. It is either inherited from the login process, or set in the .shrc or .login file which configures an individual account, or it can be run manually.

通常,默认配置等同于键入 umask 22,其产生以下权限:

Typically the default configuration is equivalent to typing 'umask 22' which produces permissions of:

-rw-r--r-- for regular files, or
drwxr-xr-x for directories.

换句话说,用户具有完全访问权限,其他人(组和其他人)都具有对文件的读取访问权限,查找对目录的访问。如上所示,文件的执行访问权限不是默认设置

In other words, user has full access, everyone else (group and other) has read access to files, lookup access to directories. As you see above, the execution access is not default for files.

因此,您需要对其进行显式更改。

Hence you need to explicitly change it.

这篇关于对下载文件执行权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆