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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 14:01:14  来源:igfitidea点击:

Laravel Forge Cannot run sudo command

laravelpasswordsrootsudoforge

提问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 SUDOpassword. You can suor sudousing this password.

当您配置您的伪造服务器时,一封带有SUDO密码的电子邮件会发送给您。您可以susudo使用此密码。

回答by Henry

I'm using Amazon lightsail with forge.

我正在使用带有伪造的亚马逊光帆。

I have a pem file provided by lightsail that allows access to the ubuntuuser 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]