creating ssh-wise identical machines



I work on debian with openssh 1:3.8.1p1-8.sarge.4

I am building an UserModeLinux machine for automated test
purposes and copy the dsa and rsa files from /etc/ssh/ onto the
uml (and set the permissions correctly). I also put my personal
ssh public key into the uml's root dir during install. Now I
get this warning when I connect to the uml from my host machine:

WARNING: DSA key found for host 10.0.2.2
in /home/andreas/.ssh/known_hosts:38
DSA key fingerprint e9:d7:8b:fa:79:70:8c:cf:05:c2:09:70:49:0c:3a:cd.
The authenticity of host '10.0.2.2 (10.0.2.2)' can't be established
but keys of different type are already known for this host.
RSA key fingerprint is 95:10:a8:18:68:74:75:3a:db:33:0c:cd:18:e0:87:bf.

I dont really understand what the problem might be. All four keys
are there and fine after each uml install and identical with the
originals (checked the sha1sum of them). do i need more files to
make the uml machines appear identical after reinstall?


======================
for entertainment, this is how i handle the copying of the files:

ome reason the user's homedir is a read only filesystem during
# the rootstrap run.

if [ ! -d $data ]; then
mkdir $data
fi

if [ -f $data/ssh_host_rsa_key -a -f $data/ssh_host_rsa_key.pub ]; then
cat $data/ssh_host_rsa_key | \
chroot $TARGET sh -c "cat > /etc/ssh/ssh_host_rsa_key"
cat $data/ssh_host_rsa_key.pub | \
chroot $TARGET sh -c "cat > /etc/ssh/ssh_host_rsa_key.pub"
chroot $TARGET chmod 600 /etc/ssh/ssh_host_rsa_key
chroot $TARGET chmod 644 /etc/ssh/ssh_host_rsa_key.pub
else
chroot $TARGET cat /etc/ssh/ssh_host_rsa_key \
> $data/ssh_host_rsa_key
chroot $TARGET cat /etc/ssh/ssh_host_rsa_key.pub \
> $data/ssh_host_rsa_key.pub
fi

if [ -f $data/ssh_host_dsa_key -a -f $data/ssh_host_dsa_key.pub ]; then
cat $data/ssh_host_dsa_key | \
chroot $TARGET sh -c "cat > /etc/ssh/ssh_host_dsa_key"
cat $data/ssh_host_dsa_key.pub | \
chroot $TARGET sh -c "cat > /etc/ssh/ssh_host_dsa_key.pub"
chroot $TARGET chmod 600 /etc/ssh/ssh_host_dsa_key
chroot $TARGET chmod 644 /etc/ssh/ssh_host_dsa_key.pub
else
chroot $TARGET cat /etc/ssh/ssh_host_dsa_key > $data/ssh_host_dsa_key
chroot $TARGET cat /etc/ssh/ssh_host_dsa_key.pub > $data/ssh_host_dsa_key.pub
fi


if [ -f $home/.ssh/id_rsa.pub ]; then
cat $home/.ssh/id_rsa.pub | chroot $TARGET sh -c "mkdir /root/.ssh; chmod 700 /root/.ssh; cat >> /root/.ssh/authorized_keys"
fi

if [ -f $home/.ssh/id_dsa.pub ]; then
cat $home/.ssh/id_dsa.pub | chroot $TARGET sh -c "mkdir /root/.ssh; chmod 700 /root/.ssh; cat >> /root/.ssh/authorized_keys"
fi

Attachment:signature.asc
Description: Digital signature



Relevant Pages

  • [opensuse] openSUSE on User-mode Linux
    ... Uml starts fine but no runlevel gets started. ... SELinux: Initializing. ... Checking for host processor cmov support...Yes ... Slow work thread pool: Ready ...
    (SuSE)
  • Re: [QUIZ #157] 32bit vs 64bit vs UML performance
    ... the benchmark consists of nearly 99% floating point operations. ... you can figure out what's going on with CodeAnalyst. ... The UML kernel is a 2.6.18 with the UML patches, the host is a 2.6.23.9 ...
    (comp.lang.ruby)
  • Re: [RFC][PATCH 01/20] pid: Intoduce the concept of a wid (wait id)
    ... system calls itself and they do the same thing as the UML system call ... so they could be left to run on the host. ... and for a container to group those namespaces. ... What I want to do is related to process migration, ...
    (Linux-Kernel)
  • [BUG] Linux 2.6.25.4 task_struct leak
    ... Linux 2.6.25.4 x86_64 task_struct leak on host when running UML ... I'm seeing a massive task_struct leak on vanilla Linux 2.6.25.4 x86_64 ... guests on a Linux 2.6.25.4 i386 host kernel. ...
    (Linux-Kernel)
  • Re: Race condition in ptrace
    ... > Working with the new UML skas0 mode on my Xeon HT host, ... > some processes on UML segfaulting. ... > granted access to child's registers as soon, as the child is removed from ... set and cleared while the runqueue is locked. ...
    (Linux-Kernel)