The more generic solution (that also works for BSD) is to edit the global /etc/ssh/ssh_config
or per-user ~/.ssh/config
and add/replace the entry:
AddressFamily any
with the following line (where inet
corresponds to ipv4
):
AddressFamily inet
You can also set this for just a single host:
Host example.com
AddressFamily inet