ssh target with 'kdump-' prefixed interface name is not
in known_hosts while dumping, leading to failure in dump_ssh.
This commit makes dump_ssh cancel 'StrictHostKeyChecking'
for link local ipv6 address cases with 'eth*' like interface
names, for it's not possible to add 'kdump-' variants in hashed
known_hosts.
Signed-off-by: Ziyue Yang <ziyang(a)redhat.com>
---
dracut-kdump.sh | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index b75c2a5..5b835af 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -71,10 +71,18 @@ dump_raw()
dump_ssh()
{
- local _opt="-i $1 -o BatchMode=yes -o StrictHostKeyChecking=yes"
+ local _opt="-i $1 -o BatchMode=yes"
local _dir="$KDUMP_PATH/$HOST_IP-$DATEDIR"
local _host=$2
+ # cancel HostKeyChecking for link-local ipv6 address
+ # with "kdump-" prefixed interface name
+ if is_prefixed_ipv6_link_local $_host; then
+ _opt+=" -o StrictHostKeyChecking=no"
+ else
+ _opt+=" -o StrictHostKeyChecking=yes"
+ fi
+
echo "kdump: saving to $_host:$_dir"
cat /var/lib/random-seed > /dev/urandom
--
2.7.4