Advertisement
LorenzoPagliara

Untitled

Aug 30th, 2023
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.62 KB | None | 0 0
  1. # $1: e-mail address (please use like "myname@domain.it")
  2. #
  3. # Dependencies:
  4. # sudo apt install xclip
  5. # sudo apt update && sudo apt install openssh-client
  6. #
  7.  
  8. ps -auxc | grep ssh-agent
  9. eval $(ssh-agent)
  10. cd ~
  11. ssh-keygen -t ed25519 -b 4096 -C $1 -f ssh-bitbucket
  12. ssh-add ~/ssh-bitbucket
  13. mkdir ~/.ssh/
  14. mv ~/ssh-bitbucket ~/ssh-bitbucket.pub ~/.ssh/
  15. echo "Host bitbucket.org
  16.  AddKeysToAgent yes
  17.  IdentityFile ~/.ssh/ssh-bitbucket" > ~/.ssh/config
  18. cat ~/.ssh/ssh-bitbucket.pub | xclip -selection clipboard
  19. echo "Now connect to https://bitbucket.org/account/settings/ssh-keys/, press 'Add key' and paste in the 'Key' field"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement