Skip to content

Commit 81ee701

Browse files
committed
Diagnose SSH tunnel authentication failures
1 parent 4a420b2 commit 81ee701

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎tests/integration/lxd.sh‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,13 @@ if grep -Eq 'changed=[1-9][0-9]*' "$second_run"; then
9797
fi
9898

9999
control_socket="$work_dir/direct-control"
100-
ssh -fNT -M -S "$control_socket" -i "$key_file" -o IdentitiesOnly=yes -o ExitOnForwardFailure=yes -o UserKnownHostsFile="$work_dir/known_hosts" -L 18443:example.com:443 "mp-ci@$ip_one"
100+
if ! ssh -vvv -fNT -M -S "$control_socket" -i "$key_file" -o IdentitiesOnly=yes -o ExitOnForwardFailure=yes -o UserKnownHostsFile="$work_dir/known_hosts" -L 18443:example.com:443 "mp-ci@$ip_one"; then
101+
sudo lxc exec megaproxy-ci-one -- getent passwd mp-ci || true
102+
sudo lxc exec megaproxy-ci-one -- passwd -S mp-ci || true
103+
sudo lxc exec megaproxy-ci-one -- namei -l /etc/ssh/megaproxy_authorized_keys/mp-ci || true
104+
sudo lxc exec megaproxy-ci-one -- sh -c "sshd -T -C user=mp-ci,host=localhost,addr=127.0.0.1 | grep -E 'authorizedkeysfile|authenticationmethods|pubkeyauthentication|allowtcpforwarding|maxsessions'" || true
105+
exit 1
106+
fi
101107
echo | openssl s_client -connect 127.0.0.1:18443 -servername example.com -verify_return_error >/dev/null
102108
ssh -S "$control_socket" -O exit "mp-ci@$ip_one"
103109

0 commit comments

Comments
 (0)