2011-01-24 04:30:13 +0000 2011-01-24 04:30:13 +0000
62
62
Advertisement

如何在局域网内ssh到ipv6的ubuntu?

Advertisement

我可以通过命令来ping我的Ubuntu盒子。(c2h2ttt在/etc/hosts中列出)

c2h2@c2h2crawler:~/ttt$ ping6 -I eth1 c2h2ttt
PING c2h2ttt(c2h2ttt) from fe80::21b:21ff:fe22:e865 eth1: 56 data bytes
64 bytes from c2h2ttt: icmp_seq=1 ttl=64 time=10.3 ms
64 bytes from c2h2ttt: icmp_seq=2 ttl=64 time=2.06 ms
64 bytes from c2h2ttt: icmp_seq=3 ttl=64 time=1.33 ms

当我尝试ssh -6 c2h2ttt时,显示:

c2h2@c2h2crawler:~/ttt$ ssh -6 c2h2ttt
ssh: connect to host c2h2ttt port 22: Invalid argument

正确的命令是什么?


在服务器端 /etc/ssh/sshd/_config 有。

ListenAddress ::
ListenAddress 0.0.0.0

我可以通过端口22上的ipv4对c2h2ttt进行ssh,netstat -lnt | grep :22

root@c2h2think:~# netstat -lnt | grep :22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN

使用了ufw,它允许端口22上的任何入站流量

root@c2h2think:~# ufw status
Status: active

To Action From
-- ------ ----
22 ALLOW Anywhere

iptables配置:

root@c2h2think:~# ip6tables -L -v -n
Chain INPUT (policy DROP 55 packets, 10758 bytes)
pkts bytes target prot opt in out source destination 
    0 0 ACCEPT all lo * ::/0 ::/0        

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target prot opt in out source destination 

Chain OUTPUT (policy DROP 0 packets, 0 bytes)
 pkts bytes target prot opt in out source destination 
    0 0 ACCEPT all * lo ::/0 ::/0
``` iptables配置: 

0x1&
Advertisement
Advertisement

答案 (3)

95
95
95
2011-01-24 06:08:40 +0000

尝试指定ssh客户端的接口。ping6 工具允许你指定一个接口,但是 ssh 没有这个开关,你必须使用这个语法。

ssh -6 fe80::21b:21ff:fe22:e865%eth1
9
9
9
2011-01-24 06:05:42 +0000

链接本地地址不应该用于SSH,它们是用于低级协议引导的东西。如果你的网络上没有ISP提供的前缀,那么可以从fd00::/8中生成一个唯一的本地前缀来代替。 http://en.wikipedia.org/wiki/Unique_local_address

2
Advertisement
2
2
2015-11-09 12:58:11 +0000
Advertisement

要连接IPv6的SSH,你的电脑上必须有IPv6的ISP连接,然后尝试以下命令。

root@hostname[~]# ssh -6 2205:f200:40:401::9ab4:8b43

这条命令会要求第一次确认SSH密钥,然后输入Y/Yes

注:2205:f200:40:401::9ab4:8b43表示你的IPv6。这只是IPv6的例子,所以不要忘记替换你的IPv6。

Advertisement

相关问题

19
12
11
16
11
Advertisement
Advertisement