]> xenbits.xensource.com Git - xentesttools/bootstrap.git/commitdiff
debugspace: Add init.custom and ssh_stuff to deal with SSH keys.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 14 Jun 2013 16:49:37 +0000 (12:49 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 14 Jun 2013 16:51:46 +0000 (12:51 -0400)
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
root_image/debugspace/init.custom [new file with mode: 0755]
root_image/debugspace/ssh_stuff/README [new file with mode: 0644]

diff --git a/root_image/debugspace/init.custom b/root_image/debugspace/init.custom
new file mode 100755 (executable)
index 0000000..0deb6ac
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+echo 10 > /proc/sys/kernel/printk
+
+sed -e 's/:\/bin\/sh$/:\/bin\/bash/' -i /etc/passwd
+
+MY_SSH_STUFF=/root/ssh_stuff/
+
+if [ -e "$MY_SSH_STUFF/ssh_host_key" ]; then
+       mv -f $MY_SSH_STUFF/ssh_*       /etc/ssh/
+
+       mkdir -p /root/.ssh
+       mv -f $MY_SSH_STUFF/authorized_keys2    /root/.ssh/
+       chmod 700 /root/.ssh
+       chmod 600 /root/.ssh/authorized_keys2
+       chmod 700 /root
+
+       export DEVELOPER_MANAGES_SSH_KEYS=1
+       export DEVELOPER_FIXED_SSH_PASSWD=password
+
+       /usr/bin/sshd_server -start
+fi
diff --git a/root_image/debugspace/ssh_stuff/README b/root_image/debugspace/ssh_stuff/README
new file mode 100644 (file)
index 0000000..a6f5c22
--- /dev/null
@@ -0,0 +1,36 @@
+I am tired of using that newly generated SSH key all the time. How can I
+put my own SSH key on the root image?
+
+In the bootstrap/debugspace/ssh_stuff create your SSH keys:
+
+        /usr/bin/ssh-keygen -t rsa1 -b 1024 -f ssh_host_key     -N '' | tail -1
+        /usr/bin/ssh-keygen -t dsa  -b 1024 -f ssh_host_dsa_key -N '' | tail -1
+        /usr/bin/ssh-keygen -t rsa  -b 1024 -f ssh_host_rsa_key -N '' | tail -1
+
+        chmod 400 ssh_host_key
+        chmod 400 ssh_host_dsa_key
+        chmod 400 ssh_host_rsa_key
+
+        rm -f ssh_host_key.pub
+        rm -f ssh_host_dsa_key.pub
+        rm -f ssh_host_rsa_key.pub
+
+Then you need to generate your own SSH keys:
+
+
+[konrad@localhost ssh_stuff]$ ssh-keygen -t rsa
+Generating public/private rsa key pair.
+Enter file in which to save the key (/home/konrad/.ssh/id_rsa): 
+Created directory '/home/konrad/.ssh'.
+Enter passphrase (empty for no passphrase): 
+Enter same passphrase again: 
+Your identification has been saved in /home/konrad/.ssh/id_rsa.
+Your public key has been saved in /home/konrad/.ssh/id_rsa.pub.
+..
+
+Copy the .ssh/id_rsa.pub in the bootstrap/debugspace/ssh_stuff/authorized_keys2
+file.
+
+The next time you login in the XTT environment it should not ask you for any
+password (except the password you might have choosen when creating your local
+key).