Passwordless ssh authentication drone

223 views Asked by At

I have setup an passwordless authentication for my ssh server. I now want to use this in an .drone.yml.

kind: pipeline
name: copy-to-www
type: ssh

server:
  host: deployserver
  user: drone

steps:
  - name: Build
    commands:

This gives me an error, saying

Linter: invalid or missing server password or ssh_key But i don't want to use a password nor a ssh_key... Thanks for help!

I did not find anything online regarding passwordless authentication in drone using ssh.

1

There are 1 answers

0
Metin On

I solved this problem with the below pipeline On the settings create ssh_password with your SSH key, directly copy your SSH private key, and put it there, it is parsing.

---
kind: pipeline
type: kubernetes # this clod be different on your case
name: SSH

steps:
- name: ssh
  image: appleboy/drone-ssh
  settings:
    host: 111.111.111.111
    username: root
    key:
      from_secret: ssh_password
    port: 22
    command_timeout: 2m
    script:
      - echo "Hello World"