forked from cloudacademy/aws-developer-fundamentals
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eric Magalhães
authored and
Eric Magalhães
committed
Jan 13, 2016
1 parent
8d6450a
commit 0a97370
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
Creating a SSH key for CodeCommit using the AWS CLI | ||
------------ | ||
###General | ||
|
||
In order to go through this tutorial make sure that you already have configures the AWS CLI in your machine and that your IAM User have Full Access permission on CodeCommit and permission to upload SSH Public Keys for IAM users. | ||
|
||
|
||
###Creating the Repository | ||
``` | ||
aws codecommit create-repository --repository-name aws-developer-fundamentals | ||
``` | ||
|
||
|
||
###Generating the SSH Key: | ||
|
||
``` | ||
cd ~/.ssh | ||
ssh-keygen | ||
# Folow the steps to create a key | ||
``` | ||
|
||
###Upload SSH Key to IAM | ||
|
||
``` | ||
aws iam upload-ssh-public-key --user-name [IAM User name] --ssh-public-key-body "$(cat [Key name .pub])" | ||
#Example: | ||
aws iam upload-ssh-public-key --user-name codecommit --ssh-public-key-body "$(cat codecommit.pub)" | ||
``` | ||
###Setting the config file | ||
|
||
``` | ||
touch config | ||
chmod 600 config | ||
vim config | ||
``` | ||
Insert this information into the **config** file: | ||
|
||
``` | ||
Host git-codecommit.*.amazonaws.com | ||
User [SSHPublicKeyId] | ||
IdentityFile ~/.ssh/[Key name] | ||
#Example: | ||
Host git-codecommit.*.amazonaws.com | ||
User AWDLIJ12384O91K | ||
IdentityFile ~/.ssh/codecommit | ||
``` | ||
|
||
###Testing | ||
|
||
``` | ||
ssh git-codecommit.us-east-1.amazonaws.com | ||
``` | ||
|