×

消息

EU e-Privacy Directive

This website uses cookies to manage authentication, navigation, and other functions. By using our website, you agree that we can place these types of cookies on your device.

View e-Privacy Directive Documents

You have declined cookies. This decision can be reversed.

ipv6是个听上去很牛,实际上却没啥用的玩意,每次装完系统都要把它禁掉。Ubuntu下面禁用ipv6很简单,在/etc/sysctl.conf里加上几行:

#Disable IPv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

启用新的配置:

sudo sysctl -p

再ifconfig发现inet6被干掉了,很灵。但随之而来有个问题,X Forwarding挂了:ssh -X或-Y不能自动设置DISPLAY,也就不能开远程X窗口了。原因是sshd有个bug,在ipv6被禁用的情况下不会自动把DISPLAY绑定到ipv4的地址,必须通过配置文件告诉它这么做,在文件/etc/ssh/sshd_config里加上一行: 

AddressFamily inet

重启sshd:

sudo service ssh restart

问题解决 

提交评论


安全码
刷新