From fe267b0fd2fb31884aeab91cd4b6de9a8d1bc42c Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 5 Mar 2014 17:03:48 +0100 Subject: [PATCH] contrib/nm-live-vm: enable ssh server and add port forward from localhost:10022 Signed-off-by: Thomas Haller --- contrib/fedora/nm-live-vm/build.sh | 1 + contrib/fedora/nm-live-vm/nm-make-script.sh | 5 +++++ contrib/fedora/nm-live-vm/run.sh | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/fedora/nm-live-vm/build.sh b/contrib/fedora/nm-live-vm/build.sh index 8cf734795d..bc1f06f24a 100755 --- a/contrib/fedora/nm-live-vm/build.sh +++ b/contrib/fedora/nm-live-vm/build.sh @@ -40,6 +40,7 @@ PACKAGES="kernel passwd git autoconf automake libtool intltool gtk-doc libnl3-de vim gdb valgrind lsof strace nmap-ncat tcpdump net-tools bridge-utils vconfig + openssh-server teamd libteam" KERNEL_URL=http://kojipkgs.fedoraproject.org/packages/kernel/3.12.9/301.fc20/i686/kernel-3.12.9-301.fc20.i686.rpm KERNEL=`basename "${KERNEL_URL%.rpm}"` diff --git a/contrib/fedora/nm-live-vm/nm-make-script.sh b/contrib/fedora/nm-live-vm/nm-make-script.sh index 79e1dff869..86ac67fe0a 100755 --- a/contrib/fedora/nm-live-vm/nm-make-script.sh +++ b/contrib/fedora/nm-live-vm/nm-make-script.sh @@ -49,6 +49,11 @@ level=DEBUG domains=ALL EOF /bin/systemctl enable NetworkManager.service || exit 1 +/bin/systemctl enable sshd.service || exit 1 + +sed -e 's/^#\?\(PermitRootLogin *\).*/\1yes/' \ + -e 's/^#\?\(PermitEmptyPasswords *\).*/\1yes/' \ + -i /etc/ssh/sshd_config mkdir /mnt/sda1 echo "/dev/sda1 /mnt/sda1 vfat defaults 1 2" >> /etc/fstab diff --git a/contrib/fedora/nm-live-vm/run.sh b/contrib/fedora/nm-live-vm/run.sh index cb8b6db7c4..d0f1ed2f28 100755 --- a/contrib/fedora/nm-live-vm/run.sh +++ b/contrib/fedora/nm-live-vm/run.sh @@ -1,7 +1,7 @@ #!/bin/sh # Three network interfaces -NET_OPTIONS="-net nic -net user -net nic -net user -net nic -net user" +NET_OPTIONS="-net nic -net user,hostfwd=tcp:127.0.0.1:10022-:22 -net nic -net user -net nic -net user" OS="Linux" if [ -f /etc/redhat-release ]; then