diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2015-03-20 17:16:32 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2015-03-20 17:16:32 +0000 |
commit | 2b73ab62ea157d1c02160169583c37cee78e4989 (patch) | |
tree | bf6f6c31934167c3fd30470ed2270c2e90741e65 /scripts | |
parent | fd790f9d509e51b6a52b1786bed4d7bfcdcec068 (diff) |
Ignore user's .ssh/known_hosts file for ssh'ing into schroot sessions
This fixes BZ1387 and implements the solution suggested by Charles. Ignoring
known_hosts for one-off ssh servers seems to be the best solution.
Cleaning up of known_hosts with already populated useless entries will be
handled as part of BZ1323.
Change-Id: Ibd7d6b358bddad5fb324f33fe7f335bf75a5dab5
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/test-schroot.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/test-schroot.sh b/scripts/test-schroot.sh index 05b8b0c2..52ef9d72 100755 --- a/scripts/test-schroot.sh +++ b/scripts/test-schroot.sh @@ -139,7 +139,7 @@ target_ssh_opts="$target_ssh_opts -o ControlMaster=auto -o ControlPersist=1m -o schroot_id=$profile-$deb_arch-$deb_dist schroot="ssh $target_ssh_opts $target schroot -r -c session:$profile-$port -d / -u root --" -rsh_opts="$target_ssh_opts -o Port=$port -o StrictHostKeyChecking=no" +rsh_opts="$target_ssh_opts -o Port=$port -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" rsh="ssh $rsh_opts" user="$(ssh $target_ssh_opts $target echo \$USER)" home="$(ssh $target_ssh_opts $target pwd)" @@ -316,7 +316,7 @@ if ! [ -z "$shared_dir" ]; then $rsh -fN -S none -R $tmp_ssh_port:127.0.0.1:$host_ssh_port $target # Recent versions of sshfs fail if ssh_command has more than a single # white spaces between options or ends with a space; filter ssh_command. - ssh_command="$(echo "ssh -o Port=$tmp_ssh_port -o IdentityFile=$home/.ssh/id_rsa-test-schroot.$$ -o StrictHostKeyChecking=no $host_ssh_opts" | sed -e "s/ \+/ /g" -e "s/ \$//")" + ssh_command="$(echo "ssh -o Port=$tmp_ssh_port -o IdentityFile=$home/.ssh/id_rsa-test-schroot.$$ -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $host_ssh_opts" | sed -e "s/ \+/ /g" -e "s/ \$//")" try="0" while [ "$try" -lt "3" ]; do $rsh $target sshfs -C -o ssh_command="\"$ssh_command\"" "$USER@127.0.0.1:$shared_dir" "$shared_dir" | true @@ -372,7 +372,7 @@ EOF fi if $ssh_master; then - ssh $orig_target_ssh_opts -o Port=$port -o StrictHostKeyChecking=no -fMN $target + ssh $orig_target_ssh_opts -o Port=$port -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -fMN $target fi # Keep the session alive when file /dont_kill_me is present |