Created
February 8, 2013 01:53
-
-
Save shrkw/4736006 to your computer and use it in GitHub Desktop.
create new user with ssh key
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
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