Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #This is a work in progress, you might not like what it does...
  2.  
  3. read -p "Enter email for SSH comment : " email_to_use
  4. email_to_use=${email_to_use:-}
  5.  
  6. read -p "Enter name for ssh key : " ssh_key_filename
  7. ssh_key_filename=${ssh_key_filename:-rsa_two}
  8.  
  9. ssh-keygen -q -t rsa -b 4096 -C "$email_to_use" -f ~/.ssh/$ssh_key_filename -P ""
  10.  
  11. config_file_key=IdentityFile
  12. new_config_file_value="~\/.ssh\/$ssh_key_filename/"
  13.  
  14. sed -i "s/\(^ $config_file_key\).*/\1 $new_config_file_value" ~/.ssh/config
  15.  
  16. echo ""
  17. cat ~/.ssh/$ssh_key_filename.pub
  18. echo ""
  19. echo "Copy the above text to GitHub as your public key. This VM will then be able to access your repositories."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement