Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper way to use AWS .pem file? #31

Closed
jimbojsb opened this issue Jul 22, 2014 · 12 comments
Closed

Proper way to use AWS .pem file? #31

jimbojsb opened this issue Jul 22, 2014 · 12 comments
Labels

Comments

@jimbojsb
Copy link

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.

@antonmedv
Copy link
Member

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

@jimbojsb
Copy link
Author

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...

@antonmedv
Copy link
Member

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

@odombrovskyi-dev
Copy link

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

@antonmedv
Copy link
Member

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

@jimbojsb
Copy link
Author

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", "git@github.com: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.

@antonmedv
Copy link
Member

Use 'pemFile' instead of 'setPemFile'.

30 июля 2014 г., в 18:21, Josh Butts notifications@github.com написал(а):

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:

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.

@jimbojsb
Copy link
Author

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

@odombrovskyi-dev
Copy link

Good news. Thanks a lot

@antonmedv
Copy link
Member

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

30 èþëÿ 2014 ã., â 21:22, Josh Butts notifications@github.com íàïèñàë(à):

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.

@notflip
Copy link

notflip commented Feb 5, 2019

I'm getting the following error

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

@antonmedv
Copy link
Member

This is deprecated, use identyFilr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants