Add SSH and create default credentials 'root:vpp'

This commit is contained in:
Pim van Pelt
2025-05-03 21:38:16 +02:00
parent 49b5d58bd6
commit 1b6e2c4726
2 changed files with 8 additions and 2 deletions

View File

@ -2,11 +2,12 @@ FROM debian:bookworm
ARG DEBIAN_FRONTEND=noninteractive
ARG VPP_INSTALL_SKIP_SYSCTL=true
ARG REPO=release
EXPOSE 22/tcp
RUN apt-get update && apt-get -y install curl procps tcpdump iproute2 iptables \
iputils-ping net-tools git python3 python3-pip vim-tiny && apt-get clean
iputils-ping net-tools git python3 python3-pip vim-tiny openssh-server && apt-get clean
# Install VPP
RUN mkdir -p /var/log/vpp
RUN mkdir -p /var/log/vpp /root/.ssh/
RUN curl -s https://packagecloud.io/install/repositories/fdio/${REPO}/script.deb.sh | bash
RUN apt-get update && apt-get -y install vpp vpp-plugin-core && apt-get clean

View File

@ -9,6 +9,11 @@ echo "Creating dataplane namespace"
/usr/bin/touch /etc/netns/$NETNS/resolv.conf
/usr/sbin/ip netns add $NETNS
echo "Starting SSH, with credentials root:vpp"
sed -i -e 's,^#PermitRootLogin prohibit-password,PermitRootLogin yes,' /etc/ssh/sshd_config
sed -i -e 's,^root:.*,root:$y$j9T$kG8pyZEVmwLXEtXekQCRK.$9iJxq/bEx5buni1hrC8VmvkDHRy7ZMsw9wYvwrzexID:20211::::::,' /etc/shadow
/etc/init.d/ssh start
echo "Generating $CLAB_VPP_FILE"
: > $CLAB_VPP_FILE
MTU=9216