Skip to content

Instantly share code, notes, and snippets.

@foursixnine
Created August 19, 2026 14:44
Show Gist options
  • Select an option

  • Save foursixnine/ad77d171d586f323c2c70fa2d186eca8 to your computer and use it in GitHub Desktop.

Select an option

Save foursixnine/ad77d171d586f323c2c70fa2d186eca8 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
export WORKDIR=/workdir
mkdir $WORKDIR
pushd $WORKDIR
zypper -n in -y osc git iproute2 openssh-server openssh screen sudo
useradd -m sshboy
# Setup sshboy
sudo -u sshboy mkdir -p /home/sshboy/.ssh
sudo -u sshboy ssh-keygen -t ed25519 -N "" -f /home/sshboy/.ssh/id_ed25519 -q
sudo -u sshboy cp /home/sshboy/.ssh/id_ed25519.pub /home/sshboy/.ssh/authorized_keys
screen -d -m -S my_session -t sshd bash -c 'source /etc/sysconfig/ssh && /usr/sbin/sshd-gen-keys-start && /usr/sbin/sshd -D $SSHD_OPTS; exec bash'
# wait for ssh (should be checking port, but fine for now)
sleep 1
# Define SSH command options for non-interactive key auth
ssh -o StrictHostKeyChecking=no -i /home/sshboy/.ssh/id_ed25519 sshboy@localhost -t 'ps -C sshd-session'
osc getbinaries Base:System procps openSUSE_Factory x86_64
osc getbinaries Base:System aaa_base openSUSE_Factory x86_64
zypper addrepo --refresh -G -p 99 $WORKDIR/binaries/ Staging:I
zypper -n dup -y --allow-vendor-change -r Staging:I # so we accept the changes from new versions in the local repo
ssh -o StrictHostKeyChecking=no -i /home/sshboy/.ssh/id_ed25519 sshboy@localhost -t 'ps -C sshd-session'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment