Laravel “envoy run” command not working with ssh k

2019-06-11 08:29发布

问题:

I am running following command in a laravel project folder and getting following error.

rakib$ envoy run list --env=production
[ubuntu@54.187.123.4]: Permission denied (publickey).

But I can successfully ssh using following command:

ssh -i ~/.ssh/sw-new.pem ubuntu@54.187.123.4

My ~/.ssh/config file content looks like:

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

Can anyone suggest me what is the possible reason of getting "Permission denied" error?

回答1:

It's possible that envoy is using the wrong user when attempting to ssh into the production server. Specify a user in your ~/.ssh/config file:

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

That should work.



回答2:

It is possible as answer above for AWS user when you attempting to ssh in production mode, after define "config" file as "~/.ssh/config":

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