Laravel Forge 无法运行 sudo 命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37893758/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Laravel Forge Cannot run sudo command
提问by Viony Veronica
I'm using "Laravel Forge" and want to run sudo to create swap file, but it's failed because i cannot run sudo command from forge user. how to have root access or run sudo comment ?
我正在使用“Laravel Forge”并想运行 sudo 来创建交换文件,但它失败了,因为我无法从 forge 用户运行 sudo 命令。如何拥有 root 访问权限或运行 sudo 评论?
回答by Ohgodwhy
When you provisioned your forge server an email was sent to you with the SUDO
password. You can su
or sudo
using this password.
当您配置您的伪造服务器时,一封带有SUDO
密码的电子邮件会发送给您。您可以su
或sudo
使用此密码。
回答by Henry
I'm using Amazon lightsail with forge.
我正在使用带有伪造的亚马逊光帆。
I have a pem file provided by lightsail that allows access to the ubuntu
user which has sudo without a password.
我有一个由 Lightsail 提供的 pem 文件,它允许在ubuntu
没有密码的情况下访问具有 sudo 的用户。
You can ssh in as ubuntu@<ip address>
if you have the pem file.
您可以像ubuntu@<ip address>
拥有 pem 文件一样通过 ssh 进入。
ssh -i ~/.ssh/xxxxxxxxxxxx.pem [email protected]
ssh -i ~/.ssh/xxxxxxxxxxxx.pem [email protected]