Skip to content

Commit

Permalink
Merge pull request #65 from moul/fix-45
Browse files Browse the repository at this point in the history
Support of `--host-key=system` to use OpenSSH keys (fix #45)
  • Loading branch information
moul committed Oct 21, 2015
2 parents 8e921d4 + 7d2f449 commit cca164e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ COMMANDS:
GLOBAL OPTIONS:
--verbose, -V Enable verbose mode
--bind, -b ":2222" Listen to address
--host-key, -k "built-in" Path or complete SSH host key to use
--host-key, -k "built-in" Path or complete SSH host key to use, use 'system' for keys in /etc/ssh
--allowed-images List of allowed images, i.e: alpine,ubuntu:trusty,1cf3e6c
--shell "/bin/sh" Default shell
--docker-run-args "-it --rm" 'docker run' arguments
Expand Down Expand Up @@ -161,6 +161,7 @@ $ docker run --privileged -v /var/lib/docker:/var/lib/docker -it --rm -p 2222:22

### master (unreleased)

* Support of `--host-key=system` to use OpenSSH keys ([#45](https://github.com/moul/ssh2docker/issues/45))
* Support of custom entrypoint ([#63](https://github.com/moul/ssh2docker/issues/63))
* Support of public-key authentication ([#2](https://github.com/moul/ssh2docker/issues/2))
* Handling custom environment variables, user and command in password script ([#57](https://github.com/moul/ssh2docker/issues/57))
Expand Down
7 changes: 5 additions & 2 deletions cmd/ssh2docker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func main() {
},
cli.StringFlag{
Name: "host-key, k",
Usage: "Path or complete SSH host key to use",
Usage: "Path or complete SSH host key to use, use 'system' for keys in /etc/ssh",
Value: "built-in",
},
cli.StringFlag{
Expand Down Expand Up @@ -151,8 +151,11 @@ func Action(c *cli.Context) {

// Register the SSH host key
hostKey := c.String("host-key")
if hostKey == "built-in" {
switch hostKey {
case "built-in":
hostKey = DefaultHostKey
case "system":
hostKey = "/etc/ssh/ssh_host_rsa_key"
}
err = server.AddHostKey(hostKey)
if err != nil {
Expand Down

0 comments on commit cca164e

Please sign in to comment.