digitalocean / digitalocean/doctl

Feature Request: Add custom known_hosts file to doctl compute ssh

Open
#449 1 comment 0 reactions 0 assignees View on GitHub
suggestion
Dominant language
Go
Stars
3.4k
Forks
496
Avg merge
1d 2h
Merged PRs (30d)
31

Description

As the title already says, I'd like to specify a custom `known_hosts` file as I would do with
```bash
> ssh -o UserKnownHostsFile=/tmp/known_hosts user@123.123.123.123
```

Currently the `doctl compute ssh` command does not support this.

The main reason for this is an automated script that gets the IPs of all current droplets and calls `ssh-keyscan` on each one to avoid this interaction.

```bash
The authenticity of host '123.123.123.123' can't be established.
Are you sure you want to continue connecting (yes/no)?
```

I would like to use this feature like this in a loop. The interaction of adding the host each time does not really work in that case.

```bash
for my-droplet-name in droplet-names; do
doctl compute ssh --ssh-known-hosts /tmp/known_hosts \
--ssh-command "do stuff here" \
$my-droplet-name
done
```

In this case, `/tmp/known_hosts` was filled by another script beforehand.

I'd be willing to create a PR for this, if the feature is wanted. After a quick code check, it looks like it is more or less just passing arguments through the call stack

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.