51-root-ssh-key 238 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
#!/bin/sh -efu

TMPDIR=/tmp
SSH_DIR=/root/.ssh

if [ -e "$TMPDIR/root_ssh_key.pub" ]; then
    mkdir -pm0700 "$SSH_DIR"
    install -v -pm0600 "$TMPDIR/root_ssh_key.pub" "$SSH_DIR/authorized_keys"
    rm -fv "$TMPDIR/root_ssh_key.pub"
fi