Skip to content

Instantly share code, notes, and snippets.

@Gnnng
Created December 14, 2019 08:13
Show Gist options
  • Save Gnnng/205296e208042f4351862833c379c549 to your computer and use it in GitHub Desktop.
Save Gnnng/205296e208042f4351862833c379c549 to your computer and use it in GitHub Desktop.
Create new user with sudo permission and github keys imported
#!/bin/bash
name=$1
gh_name=$2
sudo adduser --gecos "" --disabled-password ${name}
sudo adduser "${name}" sudo
sudo runuser - "${name}" ssh-import-id-gh "${gh_name}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment