Created
August 4, 2025 13:53
-
-
Save nazariyv/778db0d90a606ccede2006059f467aea to your computer and use it in GitHub Desktop.
new-ubuntu-user-creation-steps
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
# 1 Create a dedicated user | |
sudo adduser new_username # choose a strong password | |
# 2 Let that user sudo *only* when really needed | |
sudo usermod -aG sudo new_username | |
# 3 Switch to it | |
su - new_username | |
# 4 Copy your SSH key so you can log in directly | |
mkdir -p ~/.ssh && chmod 700 ~/.ssh | |
cat /tmp/your_pubkey.pub >> ~/.ssh/authorized_keys | |
chmod 600 ~/.ssh/authorized_keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment