Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

support to read multiple hostkeys in a file #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yuta1024
Copy link

@yuta1024 yuta1024 commented Mar 9, 2018

This PR supports to read multiple hostkeys in a file.

As a background, it is a same as #65.
A approach of this PR reads multiple keys in one file.
I would like to use this changes instead of #65.

A example of settings and hostkeys are below.

./developer_config/conf/sshd_proxy/sshd_proxy.properties

sshd.root=developer_config
sshd.port=2222
sshd.artifactoryUrl=http://localhost:4080/artifactory
# use the default.
sshd.artifactoryUsername=admin
sshd.artifactoryPassword=password

# run artifactory in the same jvm
sshd.jetty.port=4080
sshd.jetty.webapp.dir=developer_config/webapps

sshd.hostKeyPath=./developer_config/conf/sshd_proxy/ssh_host_key

./developer_config/conf/sshd_proxy/ssh_host_key

-----BEGIN DSA PRIVATE KEY-----
MIIBugIBAAKBgQCn6jiKpG0Ad1lWHKHja3lEuFdkE6AeaI2aI1ZqHPZ7GZihLFha
(snip)
InePBpfIrrLi5A4dBdk=
-----END DSA PRIVATE KEY-----
-----BEGIN RSA PRIVATE KEY-----
MIIEoQIBAAKCAQEAzy7ZPTOLMIyDD2YNVF/1SljRQwG3Yak3itiBEJaKnv5R5fnB
(snip)
zfxuPJBtHnnYU5/BSzMi8CCgbk63eHPf/WARe8DrV525UeQ+Yw==
-----END RSA PRIVATE KEY-----

The following outputs are results that verify support multiple hostkeys using above settings and hostkeys.

$ ssh -o HostKeyAlgorithms="ssh-dss" -p 2222 localhost
The authenticity of host '[localhost]:2222 ([127.0.0.1]:2222)' can't be established.
DSA key fingerprint is cd:0b:d6:61:48:bf:bd:90:fa:1c:5c:54:8a:07:b2:49.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[localhost]:2222' (DSA) to the list of known hosts.
*---------------------------------------------------*
|               _  _ _  _|    _-|-. _  _            |
|    this is a |_)| (_)(_||_|(_ | |(_)| | server    |
|              |                                    |
*---------------------------------------------------*
Connection to localhost closed.
$ ssh -o HostKeyAlgorithms="ssh-rsa" -p 2222 localhost
The authenticity of host '[localhost]:2222 ([127.0.0.1]:2222)' can't be established.
RSA key fingerprint is 24:08:6f:00:7f:38:6d:27:0d:fd:42:5e:e9:be:fb:15.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[localhost]:2222' (RSA) to the list of known hosts.
*---------------------------------------------------*
|               _  _ _  _|    _-|-. _  _            |
|    this is a |_)| (_)(_||_|(_ | |(_)| | server    |
|              |                                    |
*---------------------------------------------------*
Connection to localhost closed.

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

Successfully merging this pull request may close these issues.

1 participant