Skip to content

Commit 5f87af5

Browse files
committed
allowing firewheel ssh to work, undoing overwrite of ssh and scp
1 parent 9845e3b commit 5f87af5

File tree

4 files changed

+24
-32
lines changed

4 files changed

+24
-32
lines changed

docker/firewheel.dockerfile

+2-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
1818
ethtool libpcap-dev openvswitch-switch qemu-kvm qemu-utils \
1919
dnsmasq ntfs-3g iproute2 qemu-system-x86 software-properties-common \
2020
dosfstools openssh-server locales locales-all python3.10 python3.10-venv \
21-
vim psmisc && \
21+
vim psmisc iputils-ping && \
2222
apt-get clean && rm -rf /var/lib/apt/lists/* || { echo "Package installation failed"; exit 1; }
2323

2424
### Locale support ###
@@ -82,15 +82,11 @@ RUN bash -c "source /fwpy/bin/activate && \
8282

8383
RUN firewheel repository install -s -i || { echo "Repository installation failed"; exit 1; }
8484

85-
RUN cp /usr/bin/ssh /usr/bin/ssh-old && \
86-
cp /usr/bin/scp /usr/bin/scp-old && \
87-
cp /usr/bin/sudo /usr/bin/sudo-old && \
85+
RUN cp /usr/bin/sudo /usr/bin/sudo-old && \
8886
cp /usr/bin/chgrp /usr/bin/chgrp-old
8987

9088
COPY docker/fsroot/ /
9189
RUN chmod +x /usr/local/bin/entry && \
92-
chmod +x /usr/bin/ssh && \
93-
chmod +x /usr/bin/scp && \
9490
chmod +x /usr/bin/sudo && \
9591
chmod +x /usr/bin/chgrp && \
9692
chmod +x /start-minimega.sh

docker/fsroot/usr/bin/scp

-11
This file was deleted.

docker/fsroot/usr/bin/ssh

-14
This file was deleted.

docker/fsroot/usr/local/bin/entry

+22-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,27 @@ function gr() {
77
echo -e "\033[32;1m" "$@" "\033[m"
88
}
99

10+
function yl() {
11+
echo -e "\033[33;1m" "$@" "\033[m"
12+
}
13+
14+
# Let the SSH server run without systemd
15+
mkdir /var/run/sshd
16+
17+
# Start the SSH server
18+
/usr/sbin/sshd
19+
ssh-keygen -f ~/.ssh/id_rsa -N "" &>/dev/null
20+
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
21+
if [ -e ~/.ssh/config ];
22+
then
23+
yl "SSH config already existed, not modifying it";
24+
else
25+
cat << EOF > ~/.ssh/config
26+
Host *
27+
StrictHostKeyChecking no
28+
EOF
29+
fi
30+
1031
export HOME=/root
1132

1233
HN="$(hostname)"
@@ -75,4 +96,4 @@ until rm -rf /tmp/*; do
7596
done
7697
gr "done"
7798

78-
gr "Container shutdown."
99+
gr "Container shutdown."

0 commit comments

Comments
 (0)