Files
runc/script/setup_rootless.sh
Kir Kolyshkin 7d6848f883 script/setup_rootless.sh: chown nit
This fixes the following warning (seen on Fedora 42 and Ubuntu 24.04):

	+ sudo chown -R rootless.rootless /home/rootless
	chown: warning: '.' should be ':': ‘rootless.rootless’

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-09-16 13:27:56 -07:00

16 lines
626 B
Bash
Executable File

#!/bin/bash
set -eux -o pipefail
# Add a user for rootless tests.
sudo useradd -u2000 -m -d/home/rootless -s/bin/bash rootless
# Allow both the current user and rootless itself to use
# ssh rootless@localhost in tests/rootless.sh.
# shellcheck disable=SC2174 # Silence "-m only applies to the deepest directory".
mkdir -p -m 0700 "$HOME/.ssh"
ssh-keygen -t ecdsa -N "" -f "$HOME/.ssh/rootless.key"
sudo mkdir -p -m 0700 /home/rootless/.ssh
sudo cp "$HOME/.ssh/rootless.key" /home/rootless/.ssh/id_ecdsa
sudo cp "$HOME/.ssh/rootless.key.pub" /home/rootless/.ssh/authorized_keys
sudo chown -R rootless:rootless /home/rootless