File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ COMMANDS:
5050GLOBAL OPTIONS:
5151 --verbose, -V Enable verbose mode
5252 --bind, -b ":2222" Listen to address
53- --host-key, -k "built-in" Path or complete SSH host key to use
53+ --host-key, -k "built-in" Path or complete SSH host key to use, use 'system' for keys in /etc/ssh
5454 --allowed-images List of allowed images, i.e: alpine,ubuntu:trusty,1cf3e6c
5555 --shell "/bin/sh" Default shell
5656 --docker-run-args "-it --rm" 'docker run' arguments
@@ -161,6 +161,7 @@ $ docker run --privileged -v /var/lib/docker:/var/lib/docker -it --rm -p 2222:22
161161
162162### master (unreleased)
163163
164+ * Support of ` --host-key=system ` to use OpenSSH keys ([ #45 ] ( https://github.com/moul/ssh2docker/issues/45 ) )
164165* Support of custom entrypoint ([ #63 ] ( https://github.com/moul/ssh2docker/issues/63 ) )
165166* Support of public-key authentication ([ #2 ] ( https://github.com/moul/ssh2docker/issues/2 ) )
166167* Handling custom environment variables, user and command in password script ([ #57 ] ( https://github.com/moul/ssh2docker/issues/57 ) )
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ func main() {
6767 },
6868 cli.StringFlag {
6969 Name : "host-key, k" ,
70- Usage : "Path or complete SSH host key to use" ,
70+ Usage : "Path or complete SSH host key to use, use 'system' for keys in /etc/ssh " ,
7171 Value : "built-in" ,
7272 },
7373 cli.StringFlag {
@@ -151,8 +151,11 @@ func Action(c *cli.Context) {
151151
152152 // Register the SSH host key
153153 hostKey := c .String ("host-key" )
154- if hostKey == "built-in" {
154+ switch hostKey {
155+ case "built-in" :
155156 hostKey = DefaultHostKey
157+ case "system" :
158+ hostKey = "/etc/ssh/ssh_host_rsa_key"
156159 }
157160 err = server .AddHostKey (hostKey )
158161 if err != nil {
You can’t perform that action at this time.
0 commit comments