我有一台 Ubuntu Linux 16.04.1 服务器。启动 10 分钟后,IPV6 上的 SSH 停止工作,我无法再使用我的 IPV6 地址连接到 SSH。IPV4 一直运行良好。
有人有什么建议吗?我差点就把头撞到桌子上了。如果需要的话,很乐意提供任何日志...
如果我重新启动服务器,IPV6 可以再次正常工作 10 分钟。
/etc/ssh/sshd_config 的输出:
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 7000
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
ip6tables -L -v -n 的输出
Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
1209 138K LOCALINPUT all !lo * ::/0 ::/0
3 147 ACCEPT all lo * ::/0 ::/0
0 0 INVALID tcp !lo * ::/0 ::/0
6 576 ACCEPT all !lo * ::/0 ::/0 state RELATED,ESTABLISHED
0 0 ACCEPT tcp !lo * ::/0 ::/0 state NEW tcp dpt:25
0 0 ACCEPT tcp !lo * ::/0 ::/0 state NEW tcp dpt:7000
0 0 ACCEPT tcp !lo * ::/0 ::/0 state NEW tcp dpt:8080
0 0 ACCEPT udp !lo * ::/0 ::/0 state NEW udp dpt:25
0 0 ACCEPT udp !lo * ::/0 ::/0 state NEW udp dpt:7000
0 0 ACCEPT udp !lo * ::/0 ::/0 state NEW udp dpt:8080
4 280 ACCEPT icmpv6 !lo * ::/0 ::/0
0 0 LOGDROPIN 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
888 132K LOCALOUTPUT all * !lo ::/0 ::/0
0 0 ACCEPT tcp * !lo ::/0 ::/0 tcp dpt:53
0 0 ACCEPT udp * !lo ::/0 ::/0 udp dpt:53
0 0 ACCEPT tcp * !lo ::/0 ::/0 tcp spt:53
0 0 ACCEPT udp * !lo ::/0 ::/0 udp spt:53
3 147 ACCEPT all * lo ::/0 ::/0
0 0 INVALID tcp * !lo ::/0 ::/0
0 0 ACCEPT all * !lo ::/0 ::/0 state RELATED,ESTABLISHED
0 0 ACCEPT tcp * !lo ::/0 ::/0 state NEW tcp dpts:1:65535
6 576 ACCEPT udp * !lo ::/0 ::/0 state NEW udp dpts:1:65535
4 264 ACCEPT icmpv6 * !lo ::/0 ::/0
0 0 LOGDROPOUT all * !lo ::/0 ::/0
Chain ALLOWIN (1 references)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all !lo * X ::/0
0 0 ACCEPT all !lo * X ::/0
0 0 ACCEPT all !lo * X ::/0
0 0 ACCEPT all !lo * X ::/0
0 0 ACCEPT all !lo * X ::/0
0 0 ACCEPT all !lo * X ::/0
0 0 ACCEPT all !lo * X ::/0
0 0 ACCEPT all !lo * X ::/0
0 0 ACCEPT all !lo * X ::/0
1199 137K ACCEPT all !lo * X ::/0
Chain ALLOWOUT (1 references)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all * !lo ::/0 X
0 0 ACCEPT all * !lo ::/0 X
0 0 ACCEPT all * !lo ::/0 X
0 0 ACCEPT all * !lo ::/0 X
0 0 ACCEPT all * !lo ::/0 X
0 0 ACCEPT all * !lo ::/0 X
0 0 ACCEPT all * !lo ::/0 X
0 0 ACCEPT all * !lo ::/0 X
0 0 ACCEPT all * !lo ::/0 X
878 131K ACCEPT all * !lo ::/0 X
Chain DENYIN (1 references)
pkts bytes target prot opt in out source destination
Chain DENYOUT (1 references)
pkts bytes target prot opt in out source destination
Chain INVALID (2 references)
pkts bytes target prot opt in out source destination
0 0 INVDROP all * * ::/0 ::/0 state INVALID
0 0 INVDROP tcp * * ::/0 ::/0 tcp flags:0x3F/0x00
0 0 INVDROP tcp * * ::/0 ::/0 tcp flags:0x3F/0x3F
0 0 INVDROP tcp * * ::/0 ::/0 tcp flags:0x03/0x03
0 0 INVDROP tcp * * ::/0 ::/0 tcp flags:0x06/0x06
0 0 INVDROP tcp * * ::/0 ::/0 tcp flags:0x05/0x05
0 0 INVDROP tcp * * ::/0 ::/0 tcp flags:0x11/0x01
0 0 INVDROP tcp * * ::/0 ::/0 tcp flags:0x18/0x08
0 0 INVDROP tcp * * ::/0 ::/0 tcp flags:0x30/0x20
0 0 INVDROP tcp * * ::/0 ::/0 tcp flags:!0x17/0x02 state NEW
Chain INVDROP (10 references)
pkts bytes target prot opt in out source destination
0 0 DROP all * * ::/0 ::/0
Chain LOCALINPUT (1 references)
pkts bytes target prot opt in out source destination
1209 138K ALLOWIN all !lo * ::/0 ::/0
10 856 DENYIN all !lo * ::/0 ::/0
Chain LOCALOUTPUT (1 references)
pkts bytes target prot opt in out source destination
888 132K ALLOWOUT all * !lo ::/0 ::/0
10 840 DENYOUT all * !lo ::/0 ::/0
Chain LOGDROPIN (1 references)
pkts bytes target prot opt in out source destination
0 0 DROP tcp * * ::/0 ::/0 tcp dpt:67
0 0 DROP udp * * ::/0 ::/0 udp dpt:67
0 0 DROP tcp * * ::/0 ::/0 tcp dpt:68
0 0 DROP udp * * ::/0 ::/0 udp dpt:68
0 0 DROP tcp * * ::/0 ::/0 tcp dpt:111
0 0 DROP udp * * ::/0 ::/0 udp dpt:111
0 0 DROP tcp * * ::/0 ::/0 tcp dpt:113
0 0 DROP udp * * ::/0 ::/0 udp dpt:113
0 0 DROP tcp * * ::/0 ::/0 tcp dpts:135:139
0 0 DROP udp * * ::/0 ::/0 udp dpts:135:139
0 0 DROP tcp * * ::/0 ::/0 tcp dpt:445
0 0 DROP udp * * ::/0 ::/0 udp dpt:445
0 0 DROP tcp * * ::/0 ::/0 tcp dpt:500
0 0 DROP udp * * ::/0 ::/0 udp dpt:500
0 0 DROP tcp * * ::/0 ::/0 tcp dpt:513
0 0 DROP udp * * ::/0 ::/0 udp dpt:513
0 0 DROP tcp * * ::/0 ::/0 tcp dpt:520
0 0 DROP udp * * ::/0 ::/0 udp dpt:520
0 0 LOG tcp * * ::/0 ::/0 limit: avg 30/min burst 5 LOG flags 0 level 4 prefix "Firewall: *TCP6IN Blocked* "
0 0 LOG udp * * ::/0 ::/0 limit: avg 30/min burst 5 LOG flags 0 level 4 prefix "Firewall: *UDP6IN Blocked* "
0 0 LOG icmpv6 * * ::/0 ::/0 limit: avg 30/min burst 5 LOG flags 0 level 4 prefix "Firewall: *ICMP6IN Blocked* "
0 0 DROP all * * ::/0 ::/0
Chain LOGDROPOUT (1 references)
pkts bytes target prot opt in out source destination
0 0 LOG tcp * * ::/0 ::/0 tcp flags:0x17/0x02 limit: avg 30/min burst 5 LOG flags 8 level 4 prefix "Firewall: *TCP6OUT Blocked* "
0 0 LOG udp * * ::/0 ::/0 limit: avg 30/min burst 5 LOG flags 8 level 4 prefix "Firewall: *UDP6OUT Blocked* "
0 0 LOG icmpv6 * * ::/0 ::/0 limit: avg 30/min burst 5 LOG flags 8 level 4 prefix "Firewall: *ICMP6OUT Blocked* "
0 0 REJECT all * * ::/0 ::/0 reject-with icmp6-port-unreachable
答案1
原来是我的提供商那边的路由器出了问题。显然它正在踢出子网……现在一切正常!哇……
谢谢您的帮助!