- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
更新以下软件包后,我收到一个错误,即找不到 oauth-public.key 文件。
Package operations: 1 install, 2 updates, 0 removals
Updating laravel/framework (v5.4.27 => v5.4.28): Downloading (100%)
Installing defuse/php-encryption (v2.1.0): Downloading (100%)
Updating league/oauth2-server (5.1.3 => 5.1.4): Downloading (100%)
首先我删除了project/storage中的两个oauth-文件,然后执行这个命令:php artisan passport:install生成新的oauth-强>文件。
现在尝试访问 api 路由时出现以下错误。
(1/1) ErrorException chmod(/var/dev/project/storage/oauth-public.key): Operation failed: Operation not permitted
堆栈跟踪
in CryptKey.php (line 51)
at HandleExceptions->handleError(2, 'chmod(/var/dev/project/storage/oauth-public.key): Operation failed: Operation not permitted', '/var/dev/project/vendor/league/oauth2-server/src/CryptKey.php', 51, array('keyPath' => 'file:///var/dev/project/storage/oauth-public.key', 'passPhrase' => null, 'keyPathPerms' => '644'))
at chmod('file:///var/dev/project/storage/oauth-public.key', 384) in CryptKey.php (line 51)
at CryptKey->__construct('file:///var/dev/project/storage/oauth-public.key') in ResourceServer.php (line 50)
文件权限
-rw-r--r-- user:user oauth-private.key
-rw-r--r-- user:user oauth-public.key
更新 1
我发现 oauth Libaray 引入了安全修复程序。 Oauth V5 Security Improvements
Version 5.1.4 is a backwards compatbile with other 5.1.x releases.
You will notice in your server logs a message like this:
You must set the encryption key going forward to improve the security of this library - see this page for more information https://oauth2.thephpleague.com/v5-security-improvements/
To supress this notice once you have instantiated an instance of \League\OAuth2\Server\AuthorizationServer you should call the setEncryptionKey() method passing in at least 32 bytes of random data.
You can generate this using base64_encode(random_bytes(32)). Alternatively if you’re using a framework such as Laravel which has a encryption key already generated you can pass in that (in the case of Laravel use env('APP_KEY')).
问题是 Laravel Passport 的维护者必须解决这个问题。
更新 2
在我删除供应商文件夹并再次执行 composer install 后,我仍然遇到同样的错误。
最佳答案
试试:
sudo chown www-data:www-data storage/oauth-*.key
sudo chmod 600 storage/oauth-*.key
它解决了我的问题。
关于php - Laravel chmod(/var/dev/project/storage/oauth-public.key) : Operation failed: Operation not permitted,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44879899/
我尝试对所有子目录中的每个 HTML 文件进行 chmod 444,但是当我尝试此命令时,所有文件和文件夹都更改为 444: chmod -R 444 /home/ppp/ *.html 我只想 ch
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
我的目标是阻止除所有者之外的其他用户的修改/读取权限。 On ubuntu forums作为解决方案,给出了两种方法。 sudo useradd -d /home/newuser -m newuser
已结束。此问题不符合 Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 a specific programming problem, a software a
我正在学习 Linux 和权限。 我有以下文件夹 dir1/dir2/dir3 和 dir3 中的文件 myfile.txt。我正在尝试将 chmod 700 权限授予 dir1 和 dir2 文件夹
当我运行 chmod 777/home 时,我第一次遇到这个错误。我失去了重新连接到服务器的方法。关闭服务器后,我尝试启动一个新实例,但仍然无法连接到它。 最佳答案 这可能取决于您更新用户的权限 .s
试图在 Windows 中安装 pycrypto。在命令提示符下,我键入 python setup.py build。一切正常,但是当它进入“运行 build_configure”时,我收到此错误消息
我有一个需要更改内容的文件,该文件具有以下权限: -rw-r--r-- 如何找出我属于哪个权限组,以便执行 chmod 命令? 我刚刚尝试执行 chmod,但出现错误: $ chmod 777 h
我知道777提供了更多的写权限,但是当您使用777而不是755时,访问您网站的人可以更改您的文件吗? 有时我的文件拥有755的权限就足够了,但是有时我却是777,那不好吗? 人们不推荐它,但是为什么呢
我正在尝试在 C 程序中使用 chmod 函数更改文件权限 chmod("/tmp/toBoard", S_IRWXU | S_IRWXG | S_IRWXO); 但在程序运行后我检查权限并只获得 -
我知道 chmod -R u=rwX,g=rwX,o=r 将设置目录、子目录和文件,但要注意: The capital X permission option tells chmod to grant
一个不会工作的问题。 我有一个 XHR 文件上传到一个目录。用户在执行 php 代码的站点上按下一个按钮。在该代码上,我放置了函数 chmod($file_name, 0777); .不要介意安全问题
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求提供代码的问题必须表现出对所解决问题的最低限度理解。包括尝试过的解决方案、为什么它们不起作用,以及预
我的服务器上有一个文件夹,我已将其权限更改为 777(读取、写入和执行全部)以允许用户上传他们的图片。 所以我想知道,这其中涉及哪些安全风险? 我已经实现了代码来限制可以上传哪些文件格式,但是如果有人
我有一个关于权限的问题。我相信这 3 个标记代表所有者群体。所以我认为任何将查看我的页面的用户都将是 chmod 命令中的第 3 个标记。但是,当我将文件设置为 700 时,它应该是所有者 - 全部/
我有一个目录,其中有多个目录,每个目录包含多个图像文件。 我想将所有子目录以及其中的图像文件的文件权限更改为 755。 我正在使用 WinSCP 连接到服务器。那么如何一次性更改文件权限,因为文件很多
我想更改用户文件的 chmod 值。但它不起作用。我的代码是; $chmod = "0777"; chmod($filename, $chmod); 我正在输入 chmod 777。但是文件的 chm
我试图从我的 C 程序中调用 chmod() 函数,但是它没有设置正确的权限,除非 mode_t 参数有其中有前导零。例如 chmod(argv[2],00777) 会起作用,但是 chmod(arg
我想更改用户文件的 chmod 值。但它不起作用。我的代码是; $chmod = "0777"; chmod($filename, $chmod); 我正在输入 chmod 777。但是文件的 chm
我正面临一个烦人的问题。这很令人沮丧。我正在学校使用计算机来学习 Coursera Startup 类(class)。我正在尝试连接到 Amazon EC2 实例。我下载了 key 对。我检查权限。
我是一名优秀的程序员,十分优秀!