Last active
December 21, 2023 06:33
-
-
Save SaKKo/a38773e28bddf9f34fd59f2369a8a0c3 to your computer and use it in GitHub Desktop.
This file contains 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
# Add user | |
adduser ubuntu | |
# Set to super user | |
usermod -aG sudo ubuntu | |
# Switch user | |
sudo su ubuntu | |
# Add .ssh to ubuntu user | |
mkdir ~/.ssh | |
cd ~/.ssh | |
touch authorized_keys | |
# generate key in LOCAL | |
ssh-keygen # then input filename | |
# Copy .pub content to authorized_keys | |
# in LOCAL | |
cat ~/.ssh/filename.pub | |
# Copy content | |
# on SERVER | |
nano ~/.ssh/authorized_keys | |
# paste ~/.ssh/filename.pub content | |
# Make ubuntu user sudo without password | |
sudo visudo | |
# add this text to the last line then save | |
ubuntu ALL=(ALL) NOPASSWD:ALL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment