如何 SSH 到 IPv6 地址

如果你的 IPv6 地址以 fe80:: 开头

这种类型的 IPv6 地址称为链路本地,因此特定于你计算机上的网络接口。你可以使用 ifconfig 显示有关网络接口的信息。你要查找类似 eth0wlan0enp3s0wlp4s0tap1 的标识符。在此示例中我们使用 eth0

现在你可以使用以下方式连接到 IPv6:

ssh_ipv6_examples.sh
ssh <username>@<ipv6 address>%<interface>

例如

ssh_ipv6_linklocal_example.sh
ssh user@fe80::21b:21ff:fe22:e865%eth0

<interface> 替换为正确的接口(如果你不知道,尝试每个接口),将 <ipv6 address> 替换为正确的 IP 地址,将 <user> 替换为正确的用户名。

如果你的 IPv6 地址不以 fe80:: 开头

你只需使用

ssh_ipv6_generic.sh
ssh <username>@<ipv6 address>

例如

ssh_ipv6_example.sh
ssh uli@2a01:4f9:c010:278::1

<ipv6 address> 替换为正确的 IP 地址,将 <user> 替换为正确的用户名。


Check out similar posts by category: Linux, Networking