Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh: Could not resolve hostname : hostname nor servname provided, or not known #4

Closed
djkerya opened this issue Sep 6, 2020 · 2 comments
Assignees

Comments

@djkerya
Copy link

djkerya commented Sep 6, 2020

ssh: Could not resolve hostname : hostname nor servname provided, or not known
ssh: Could not resolve hostname : hostname nor servname provided, or not known
ERR: cannot establish ssh-connection

@akokarev
Copy link

akokarev commented Oct 8, 2020

Check ping to hostname, check dns server. Use IP address, not hostname/domain name. This problem is not with script.

@tenhishadow
Copy link
Owner

tenhishadow commented Nov 20, 2020

from example.conf:

#### Connection ####################################

@djkerya please just configure your devices using ssh config file like described here:
https://www.digitalocean.com/community/tutorials/how-to-configure-custom-connection-options-for-your-ssh-client
idea is that script just use ssh and you configure ssh outside the script using this approach.

I configure it like this:

# gw jump
host mikrotik1
  User backup_user
  Hostname 1.1.1.1
  IdentityFile ~/.ssh/mykey

# ap
host mikrotik-ap1
  User backup_user
  Hostname 192.168.88.2
  ProxyJump mikrotik1 # use gw as an entrypoint
  IdentityFile ~/.ssh/mykey

This is an advanced usage that could cover any cases
basically you could read it using man:

man ssh
man ssh_config

@tenhishadow tenhishadow self-assigned this Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants