drone-ssh: Key not used during SSH handshake
I have my key_path set and properly mounted, but it seems it’s not even used during SSH handshake:
2017/03/03 14:45:08 staging.xxxxxx.com: outputs:
0s
8
2017/03/03 14:45:08 drone-ssh error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain
0s
9
ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain
This is how the pipeline looks like:
ssh:
image: appleboy/drone-ssh
when:
branch: [staging, production]
host: ${DRONE_BRANCH}.xxxxxx.com
port: 9999
user: root
key_path: /root/${DRONE_BRANCH}.key
script:
- echo "yay"
And my docker-compose.yml:
drone-server:
container_name: xxxxxxx-ci
image: drone/drone:0.5
volumes:
- /var/lib/drone:/var/lib/drone
restart: always
env_file: drone.env
drone-agent:
image: drone/drone:0.5
command: agent
restart: always
depends_on: [ drone-server ]
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /root/staging.key:/root/staging.key
env_file: drone.env
Of course, the .key file is present:
-rw-r--r-- 1 root root 3326 Mar 1 12:57 staging.key
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 26 (7 by maintainers)
I have enabled the
Trusted
option on Project Settings , but still not working withkey_path
.But I find a solution: Mount private key to the plugin’s container instead of drone agent.
pipeline:
That works!
Of course, enabled the
Trusted
mode is required.@harryxu @fredix Already updated readme. See the updates: https://github.com/appleboy/drone-ssh#mount-key-from-file-path
hi @appleboy , I have the same issue, my pipeline is
my yml for docker swarm is
permission is set to 400