Skip to content

Instantly share code, notes, and snippets.

@richarddewit

richarddewit/su

Created Sep 16, 2020
Embed
What would you like to do?
A `su` replacement using machinectl
#!/usr/bin/env bash
if [[ "$1" == "-" ]]; then
shift
fi
if [ -z "$1" ]; then
echo "Missing argument USER"
exit 1
fi
machinectl shell --uid=$(id -u "$1")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.