Skip to content

Instantly share code, notes, and snippets.

@Rusydy
Created November 11, 2025 19:03
Show Gist options
  • Select an option

  • Save Rusydy/82ac244cdc741f1defbdbd28f69e1cce to your computer and use it in GitHub Desktop.

Select an option

Save Rusydy/82ac244cdc741f1defbdbd28f69e1cce to your computer and use it in GitHub Desktop.
# Quick Setup with Copy-Paste
## Set your username and public key
USERNAME="yourusername"
PUBLIC_KEY="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIxxxxxx [email protected]"
## Create user and setup
useradd -m -G wheel $USERNAME
passwd $USERNAME
mkdir -p /home/$USERNAME/.ssh
echo "$PUBLIC_KEY" > /home/$USERNAME/.ssh/authorized_keys
chmod 700 /home/$USERNAME/.ssh
chmod 600 /home/$USERNAME/.ssh/authorized_keys
chown -R $USERNAME:$USERNAME /home/$USERNAME/.ssh
echo "User $USERNAME created with SSH key access and sudo capability"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment