Skip to content

Commit

Permalink
Merge pull request #3 from joknarf/resolve_warn
Browse files Browse the repository at this point in the history
Resolve warn
  • Loading branch information
joknarf authored Jul 6, 2024
2 parents aa0d30b + 71e180a commit 2e3144b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ SSHP_DOMAINS="domain1.com domain2.com" ssh-para -r -H host1 host2 -- echo connec

# Tips

* ssh-para uses ssh BatchMode, no interactive password/passphrase will be asked, so you need to have a ssh authorized key to connect to servers (ssh-agent...)
* you need to configure your ssh for StrictHostKeyChecking/UserKnownHostsFile if you need to connect to unknown servers
* to connect as different user use ssh -l option or define everything in your ssh config file
* *you can use user@host as hostname but not if you need to resolve host (-r/--resolve)*
* if you are using ssh ProxyJump server to reach hosts, you may need to tweak the sshd MaxStartups setting on the ssh Proxy server with high parallelism
* when ssh-para starts, a delay of 0.3 seconds is applied between threads starting ssh jobs to avoid flooding, (can be tweaked with -D <delay>)
* *when ssh-para starts, a delay of 0.3 seconds is applied between threads starting ssh jobs to avoid flooding, (can be tweaked with -D <delay>)*
* if you are using remote connexion to launch the ssh-para, use `screen` to launch ssh-para, as if you lose your connection, ssh-para will be still running and you can re-attach to `screen` to continue follow-up.
* Be very carefull when launching massive commands on servers... Always first test on non production.
2 changes: 2 additions & 0 deletions ssh_para/ssh_para.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def resolve_hostname(host):
try:
res = gethostbyname_ex(host)
except OSError:
print(f"Warning: ssh-para: cannot resolve {host}", file=sys.stderr)
return None
return res[0]

Expand All @@ -112,6 +113,7 @@ def resolve_ip(ip):
try:
host = gethostbyaddr(ip)
except OSError:
print(f"Warning: ssh-para: cannot resolve {ip}", file=sys.stderr)
return ip
return host[0]

Expand Down

0 comments on commit 2e3144b

Please sign in to comment.