Skip to content

Instantly share code, notes, and snippets.

@shrkw
Created February 8, 2013 01:53
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 shrkw/4736006 to your computer and use it in GitHub Desktop.
Save shrkw/4736006 to your computer and use it in GitHub Desktop.
create new user with ssh key
read USER_NAME
useradd ${USER_NAME}
mkdir -m 700 /home/${USER_NAME}/.ssh
cat << _EOF_ > /home/${USER_NAME}/.ssh/authorized_keys
chmod 400 /home/${USER_NAME}/.ssh/authorized_keys
chown ${USER_NAME}:${USER_NAME} -R /home/${USER_NAME}/.ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment