07.generate_ssh_key.ksh 1.1 KB

12345678910111213141516171819202122232425262728
  1. #!/bin/ksh
  2. print "In a web browser, create or access your personal Github account (Optional):"
  3. print " 1) In a new tab, open https://github.com in a web browser."
  4. print " 2) Access with your personal Github credentials or create a new one."
  5. print " 3) Access to https://github.com/settings/keys and leave it open"
  6. print ""
  7. echo -e "\033[33;5m Don't close Github page when finished... \033[0m"
  8. print ""
  9. read -r "Press enter when finish to create ssh keys..."
  10. print -n "Generate ssh keys?: (Y|n) ";read -r option; print ""
  11. cat /dev/zero | ssh-keygen -q -t rsa -N ""
  12. print "Generate ssh key in $HOME/.ssh/id_rsa.pub file... DONE"
  13. #xclip -sel PRIMARY <"$HOME"/.ssh/id_rsa.pub
  14. #print "Copying content of '$HOME/.ssh/id_rsa.pub' file to the clipboard... DONE"
  15. #print ""
  16. #echo -e "\033[33;5m If you copy other thing to the clipboard, here is your ssh public key, ready to copy again... \033[0m"
  17. #print ""
  18. cat "$HOME"/.ssh/id_rsa.pub
  19. print ""
  20. print "Add SSH keys to Github account (Optional):"
  21. print " 1) Access ssh-keys settings in https://github.com/settings/keys"
  22. print " 2) Paste the key copied from $HOME/.ssh/id_rsa.pub and press 'Add key' button."
  23. print ""