diff --git a/.circleci/docker-compose.yml b/.circleci/docker-compose.yml new file mode 100644 index 00000000..ad5530fa --- /dev/null +++ b/.circleci/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3' + +services: + sshd: + image: panubo/sshd:latest + ports: + - "2222:22" + volumes: + - ../os-integration-test/etc/ssh/authorized_keys:/root/.ssh/authorized_keys + - ../os-integration-test/etc/ssh/ssh_host_rsa_key:/etc/ssh/ssh_host_rsa_key + - ../os-integration-test/etc/ssh/ssh_host_dsa_key:/etc/ssh/ssh_host_dsa_key + - ../os-integration-test/etc/ssh/ssh_host_ecdsa_key:/etc/ssh/ssh_host_ecdsa_key + - ../os-integration-test/etc/ssh/ssh_host_ed25519_key:/etc/ssh/ssh_host_ed25519_key + environment: + - SSH_ENABLE_ROOT=true diff --git a/cli/gssh-example.groovy b/cli/gssh-example.groovy index 526c9e81..4a95be73 100644 --- a/cli/gssh-example.groovy +++ b/cli/gssh-example.groovy @@ -1,8 +1,8 @@ ssh.remotes { tester { host = 'localhost' - port = 22 - user = 'tester' + port = 2222 + user = 'root' identity = new File('os-integration-test/etc/ssh/id_rsa') knownHosts = addHostKey(new File('cli/build/known_hosts')) } @@ -15,5 +15,5 @@ ssh.run { } assert new File('cli/build/known_hosts').readLines().any { line -> - line.startsWith('localhost ssh-rsa') + line.startsWith('localhost ecdsa-sha2-nistp256') } diff --git a/docs/src/docs/asciidoc/getting-started.adoc b/docs/src/docs/asciidoc/getting-started.adoc index 9cbb1de0..d97a726f 100644 --- a/docs/src/docs/asciidoc/getting-started.adoc +++ b/docs/src/docs/asciidoc/getting-started.adoc @@ -56,7 +56,7 @@ Gradle 2.0 style: ---- buildscript { repositories { - jcenter() + mavenCentral() } dependencies { classpath 'org.hidetake:gradle-ssh-plugin:{gradle-ssh-version}' @@ -73,7 +73,7 @@ The plugin also supports Gradle 1.x with the backport library: ---- buildscript { repositories { - jcenter() + mavenCentral() } dependencies { classpath 'org.hidetake:gradle-ssh-plugin:{gradle-ssh-version}' diff --git a/docs/src/docs/asciidoc/user-guide.adoc b/docs/src/docs/asciidoc/user-guide.adoc index 764270aa..966013f9 100644 --- a/docs/src/docs/asciidoc/user-guide.adoc +++ b/docs/src/docs/asciidoc/user-guide.adoc @@ -1637,7 +1637,7 @@ Following example transfers the `groovy-all` jar and execute a script on the rem [source,groovy] ---- repositories { - jcenter() + mavenCentral() } configurations { diff --git a/os-integration-test/etc/ssh/authorized_keys b/os-integration-test/etc/ssh/authorized_keys new file mode 100644 index 00000000..dc4dbd9c --- /dev/null +++ b/os-integration-test/etc/ssh/authorized_keys @@ -0,0 +1,3 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDvyn/5Z5s4TjxpCTJT0csJ7MeARchWzppcofSuAGaWeY0gR/vLxNZ1DupBPV6x7GGYZKkKP+n2JJ95ZO/TAbtPQfrq2hS24HtmVXeIQNhdJ5gFgplv5wAEOGX1t8Vy4tHlcMGtMYp+JvIup8YiHW6uic9QMaE5/3Q2DobllAQr17yDgEU9catR70FKqisemlOUaYc9KQWa3gZ8d6rHtfaAI1HnK6U7rH9ZzXmejyvSt6NhT7iQ2yJMF0HOpdQmnDqxJr5jOeWrgf0TbwW0AN3TXrqLFpUdy2DCWF0XEMOaLZhINMV1yxShYAUzhqbnP0voKoKv8IaSG/htJKAVIXn9 +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC1xN7CzvOi8IOUqXs+y7BvCwr52enPvcaObR5ymVMZKwPiXXqNKOnvQsKv23JxSOfoHS7WeWqTCkxrawsTSB6ZO7qy6AHxF1qa26KGuwkgbAa7wZIAQtrAH/li04jllxDKYdcriq76poVVvK76q6ASxAy76eboWDrABBXhNWD1pHZj5pE0vKpdGRnAqe/vWIkkmJLy5cVwcrKz8RThtTYv1w5Wuzp2z4W7+O9oFXvYr76lztxLSMtgGcoM6hRUdn+CfBP4aN8LBr0MnvAcQec2aZUOEBFl8q73ZRQ10SmZciIaLEBI/MrB0Oa/TY48/FcQjwaFmQdyp2AIG/tQdzmx your_email@example.com +ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmU+yuKZZrxAE61hYT1sm0cOKbUie5d61zXPw4ehgWiwyZYtEmH+pDmh/MZfxB6W8QUxOj/ClSYGtbnrDuFm1Y= diff --git a/os-integration-test/run-sshd.sh b/os-integration-test/run-sshd.sh index 831e3b17..62f8b10e 100755 --- a/os-integration-test/run-sshd.sh +++ b/os-integration-test/run-sshd.sh @@ -1,10 +1,3 @@ #!/bin/bash -xe -exec docker run --rm -p 22:22 \ - -e "SSH_HOST_DSA_KEY=$(cat etc/ssh/ssh_host_dsa_key)" \ - -e "SSH_HOST_RSA_KEY=$(cat etc/ssh/ssh_host_rsa_key)" \ - -e "SSH_HOST_ECDSA_KEY=$(cat etc/ssh/ssh_host_ecdsa_key)" \ - -e "SSH_HOST_ED25519_KEY=$(cat etc/ssh/ssh_host_ed25519_key)" \ - -e "SSH_AUTHORIZED_KEYS=$(cat etc/ssh/id_rsa.pub etc/ssh/id_rsa_pass.pub etc/ssh/id_ecdsa.pub)" \ - --name sshd \ - int128/sshd +exec docker-compose -f $( dirname -- "$0"; )/../.circleci/docker-compose.yml up diff --git a/os-integration-test/src/main/groovy/org/hidetake/groovy/ssh/test/os/Fixture.groovy b/os-integration-test/src/main/groovy/org/hidetake/groovy/ssh/test/os/Fixture.groovy index e43576d3..c73c9d86 100644 --- a/os-integration-test/src/main/groovy/org/hidetake/groovy/ssh/test/os/Fixture.groovy +++ b/os-integration-test/src/main/groovy/org/hidetake/groovy/ssh/test/os/Fixture.groovy @@ -16,8 +16,8 @@ class Fixture { service.remotes { Default { host = 'localhost' - port = 22 - user = 'tester' + port = 2222 + user = 'root' identity = new File("etc/ssh/id_rsa") knownHosts = addHostKey(new File("build/known_hosts")) }