[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pretest-users] Sending data from host to guest in qemu
From: |
Assaf Gordon |
Subject: |
Re: [Pretest-users] Sending data from host to guest in qemu |
Date: |
Sun, 7 Jun 2015 21:49:52 -0400 |
Hello Gavin,
On Jun 7, 2015, at 19:32, Gavin Smith <address@hidden> wrote:
> On 3 June 2015 at 20:51, Assaf Gordon <address@hidden> wrote:
>>
>> Then, from the host, you can login with SSH:
>> ssh -p 1025 address@hidden
>
> I encountered a hiccough when I tried this for another image. I tried
> the NetBSD image with:
<...>
> bash $scp -o Port=1025 texinfo-5.9.93.tar.gz address@hidden:/home/miles
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<...>
> Offending ECDSA key in /home/g/.ssh/known_hosts:9
> ECDSA host key for [localhost]:1025 has changed and you have requested
> strict checking.
> Host key verification failed.
>
> If anyone else has the same problem, what they need to do is use a
> different port number. In my case, I used port 1026 instead and it
> worked fine.
Yes - good point - 'scp' and 'ssh' to a 'pretest' virtual image is exactly like
SSH into any other host - SSH will cache the hosts' key in the
'~/.ssh/known_hosts' file and will warn when it changes.
Few additional options are:
1. delete the host key with gnu sed: the offending ECDSA key is reported in the
above error message to be in line 9, and it can be deleted like so:
sed -i 9d ~/.ssh/known_hosts
2. delete using 'ssh-keygen' - depending the version of your ssh, 'ssh-keygen'
can delete all know keys of a host using:
ssh-keygen -R hostname
3. Tell SSH not to check the host key, and not to write it to your
'~/.ssh/known_hosts'.
This is what I use myself.
The command with OpenSSH is:
ssh -o StrictHostKeyChecking=no \
-o CheckHostIP=no \
-o UserKnownHostsFile=/dev/null \
address@hidden
Or with an easy alias:
alias ussh='ssh -o StrictHostKeyChecking=no -o CheckHostIP=no -o
UserKnownHostsFile=/dev/null'
Obviously, host fingerprint check should be skipped only when you are sure this
is a pretest virtual machine, not by default...
4. Don't use "-snapshot" with the QEMU parameters: this will keep the virtual
machine's disk/files hanged between invocations, and the host's key will
remain. this only works if you're using the same VM, of course.
Regards,
- assaf