Deployer: Proper way to use AWS .pem file?

Created on 22 Jul 2014  ·  12Comments  ·  Source: deployphp/deployer

Hi, I'm trying to test a deployment with ssh + git, but I cannot figure out the proper way to use my .pem private key that lets me SSH into AWS instances. This is normally done with ssh -i key.pem or similar. I've tried setting is as both a public and a private key, to no avail. Also it seems that deployer is not properly recognizing the fact that phpseclib is failing in this case.

feature

All 12 comments

You can use openssl_pkey_get_public to extract the pub/private keys.
I will try to implement this automatically in next release.

I was looking at that function before posting, it does not seem to work properly. The .pem file I have is not an x509, it is a private RSA key, like:

-----BEGIN RSA PRIVATE KEY-----
.........key..........
-----END RSA PRIVATE KEY-----

I've tried setting that to both the public and private key, to no avail. openssl_pkey_get_public returns false on that...

Ok, i'll try to deploy on AWS by myself.

So, do you have any decisions how to deploy on AWS?

Here it is http://deployer.in/#with-pem-file :gem:

Cool, I looked at the code you changed and it seems fairly obvious, but it doesn't seem to work for me.

[josh@orangeslice ~/projects/seaglass (master)]$ dep deploy
Preparing server for deploy.................................Password: 
✔
Updating code...............................................✔
Installing vendors..........................................✔
Creating symlink to release.................................✔
Cleaning up old releases....................................✔
Successfully deployed on banzai.aws

But nothing actually happens. There is no password, not sure why it's prompting for that. I hit enter at the password prompt and everything completes without error, but nothing is copied or checked out.

Redacted code from deploy file:

<?php
require 'recipe/composer.php';
set('use_ssh2', false);
set("repository", "[email protected]:org/repo.git");

server("web", "server.aws")
    ->user("ubuntu")
    ->path('/www/repo-deploytest')
    ->setPemFile("~/.ssh/aws.pem");

I'm happy to contribute as necessary to make this work.

Use 'pemFile' instead of 'setPemFile'.

30 июля 2014 г., в 18:21, Josh Butts [email protected] написал(а):

Cool, I looked at the code you changed and it seems fairly obvious, but it doesn't seem to work for me.

[josh@orangeslice ~/projects/seaglass (master)]$ dep deploy
Preparing server for deploy.................................Password:

Updating code...............................................✔
Installing vendors..........................................✔
Creating symlink to release.................................✔
Cleaning up old releases....................................✔
Successfully deployed on banzai.aws
But nothing actually happens. There is no password, not sure why it's prompting for that. I hit enter at the password prompt and everything completes without error, but nothing is copied or checked out.

Redacted code from deploy file:

require 'recipe/composer.php';
set('use_ssh2', false);
set("repository", "[email protected]:org/repo.git");

server("web", "server.aws")
->user("ubuntu")
->path('/www/repo-deploytest')
->setPemFile("~/.ssh/aws.pem");

I'm happy to contribute as necessary to make this work.


Reply to this email directly or view it on GitHub.

Ah, a simple error on my part. Works flawlessly now. Thanks so much for adding this.

Good news. Thanks a lot

I'll make all set methods private to clearly api.

30 èþëÿ 2014 ã., â 21:22, Josh Butts [email protected] íàïèñàë(à):

Ah, a simple error on my part. Works flawlessly now. Thanks so much for adding this.


Reply to this email directly or view it on GitHub.

I'm getting the following error

 [Error] Call to undefined method Deployer\Host\Host::pemFile()

This is deprecated, use identyFilr

Was this page helpful?
0 / 5 - 0 ratings

Related issues

osbulbul picture osbulbul  ·  3Comments

greatwitenorth picture greatwitenorth  ·  4Comments

ElForastero picture ElForastero  ·  3Comments

brunodevel picture brunodevel  ·  3Comments

JonasDoebertin picture JonasDoebertin  ·  4Comments