Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel “拉雷维尔”;特使跑";命令不使用ssh密钥_Laravel_Ssh_Laravel Envoy - Fatal编程技术网

Laravel “拉雷维尔”;特使跑";命令不使用ssh密钥

Laravel “拉雷维尔”;特使跑";命令不使用ssh密钥,laravel,ssh,laravel-envoy,Laravel,Ssh,Laravel Envoy,我正在laravel项目文件夹中运行以下命令,并得到以下错误 rakib$ envoy run list --env=production [ubuntu@54.187.123.4]: Permission denied (publickey). 但我可以使用以下命令成功地ssh: ssh -i ~/.ssh/sw-new.pem ubuntu@54.187.123.4 我的~/.ssh/config文件内容如下所示: Host 54.187.123.4 IdentityFile ~

我正在laravel项目文件夹中运行以下命令,并得到以下错误

rakib$ envoy run list --env=production
[ubuntu@54.187.123.4]: Permission denied (publickey).
但我可以使用以下命令成功地ssh:

ssh -i ~/.ssh/sw-new.pem ubuntu@54.187.123.4
我的~/.ssh/config文件内容如下所示:

Host 54.187.123.4
    IdentityFile ~/.ssh/sw-new.pem

有人能告诉我出现“权限被拒绝”错误的可能原因吗?

可能是特使在尝试使用ssh连接到生产服务器时使用了错误的用户。在~/.ssh/config文件中指定用户:

Host 54.187.123.4
    IdentityFile ~/.ssh/sw-new.pem
    User ubuntu
这应该是可行的。

在将配置文件定义为“~/.ssh/config”之后,当您尝试在生产模式下使用ssh时,AWS用户可以:

Host ec2-52-29-45-15.eu-central-2.compute.amazonaws.com
    IdentityFile /home/tux/Desktop/ssh/masterpro.pem
    User ubuntu