Closed djkerya closed 3 years ago
Check ping to hostname, check dns server. Use IP address, not hostname/domain name. This problem is not with script.
from example.conf: https://github.com/tenhishadow/mbkp/blob/15fdaf72e59b83e22a464172126c25b85d781c9d/example.cfg#L7
@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
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