mirror of
https://github.com/opencontainers/runc.git
synced 2025-09-26 19:41:35 +08:00

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>
16 lines
626 B
Bash
Executable File
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
|