Skip to content

Instantly share code, notes, and snippets.

@avi-antares
Last active July 29, 2022 12:25
Show Gist options
  • Save avi-antares/041a2422bc6f50070521020bf9630afe to your computer and use it in GitHub Desktop.
Save avi-antares/041a2422bc6f50070521020bf9630afe to your computer and use it in GitHub Desktop.
Linode User Create
## On the Linode Machine
````
ssh root@$LINODE_MACHINE_FQDN
# Create User
# USER=<username>
useradd -m -d /home/$USER -s /bin/bash $USER
# "su" as the user and setup a few things
su - $USER
cd
mkdir .ssh
touch .ssh/authorized_keys
````
## On User's Local Machine
````
ssh-keygen -t rsa
````
Once the .ssh/id_rsa* files have been created, copy the contents of the file ".ssh/rsa_id.pub" into the ".ssh/authorized_keys" on the Linode host.
## On the Linode Machine
````
chown -R $USER:$USER /home/$USER/.ssh
chmod 700 /home/$USER/.ssh
chmod 600 /home/$USER/.ssh/authorized_keys
````
## Adding to sudo group
````
usermod -aG sudo $USER
````
To enable nopassword,
````
sudo visudo
````
and add the following line to the end (replace $USER with the specific user)
````
$USER ALL=(ALL) NOPASSWD: ALL
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment