Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
e3e024da
Commit
e3e024da
authored
Jul 01, 2015
by
Zach Loafman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10614 from justinsb/aws_ssh_fingeprint
AWS: Use the SSH key fingerprint, not the AWS fingerprint
parents
7f268f9b
2a8d4686
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
util.sh
cluster/aws/util.sh
+13
-1
No files found.
cluster/aws/util.sh
View file @
e3e024da
...
...
@@ -301,11 +301,20 @@ function detect-ubuntu-image () {
# Note that this is a different hash from the OpenSSH hash.
# But AWS gives us this public key hash in the describe keys output, so we should stick with this format.
# Hopefully this will be done by the aws cli tool one day: https://github.com/aws/aws-cli/issues/191
# NOTE: This does not work on Mavericks, due to an odd ssh-keygen version, so we use get-ssh-fingerprint instead
function
get-aws-fingerprint
{
local
-r
pubkey_path
=
$1
ssh-keygen
-f
${
pubkey_path
}
-e
-m
PKCS8 | openssl rsa
-pubin
-outform
DER | openssl md5
-c
|
sed
-e
's/(stdin)= //g'
}
# Computes the SSH fingerprint for a public key file ($1)
# #1: path to public key file
# Note this is different from the AWS fingerprint; see notes on get-aws-fingerprint
function
get-ssh-fingerprint
{
local
-r
pubkey_path
=
$1
ssh-keygen
-lf
${
pubkey_path
}
|
cut
-f2
-d
' '
}
# Import an SSH public key to AWS.
# Ignores duplicate names; recommended to use a name that includes the public key hash.
# $1 name
...
...
@@ -660,7 +669,10 @@ function kube-up {
ssh-keygen
-f
"
$AWS_SSH_KEY
"
-N
''
fi
AWS_SSH_KEY_FINGERPRINT
=
$(
get-aws-fingerprint
${
AWS_SSH_KEY
}
.pub
)
# Note that we use get-ssh-fingerprint, so this works on OSX Mavericks
# get-aws-fingerprint gives the same fingerprint that AWS computes,
# but OSX Mavericks ssh-keygen can't compute it
AWS_SSH_KEY_FINGERPRINT
=
$(
get-ssh-fingerprint
${
AWS_SSH_KEY
}
.pub
)
echo
"Using SSH key with (AWS) fingerprint:
${
AWS_SSH_KEY_FINGERPRINT
}
"
AWS_SSH_KEY_NAME
=
"kubernetes-
${
AWS_SSH_KEY_FINGERPRINT
//
:/
}
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment