Created
November 11, 2025 19:03
-
-
Save Rusydy/82ac244cdc741f1defbdbd28f69e1cce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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