Skip to content

Instantly share code, notes, and snippets.

@demiters
Created July 24, 2020 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save demiters/f51a0094eee3e56ea55b0e31095d9fbb to your computer and use it in GitHub Desktop.
Save demiters/f51a0094eee3e56ea55b0e31095d9fbb to your computer and use it in GitHub Desktop.
Creates non-root user with ssh key auth on remote Ubuntu 20.04 server
#!/bin/bash
# Creates non-root user who can use ssh key auth, edit to your liking.
sudo apt install rsync
adduser arturs
usermod -aG sudo arturs
rsync --archive --chown=arturs:arturs ~/.ssh /home/arturs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment