Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # Generates a new SSH key for BitBucket
- #
- # Usage:
- # bash ssh_bitbucket.sh <bitbucket email address>
- #
- # Dependencies:
- # sudo apt install xclip openssh-client
- #
- ps -auxc | grep ssh-agent
- eval $(ssh-agent)
- cd ~
- ssh-keygen -t ed25519 -b 4096 -C $1 -f ssh-bitbucket
- ssh-add ~/ssh-bitbucket
- mkdir -p ~/.ssh/
- mv ~/ssh-bitbucket ~/ssh-bitbucket.pub ~/.ssh/
- echo "Host bitbucket.org
- AddKeysToAgent yes
- IdentityFile ~/.ssh/ssh-bitbucket" > ~/.ssh/config
- cat ~/.ssh/ssh-bitbucket.pub | xclip -selection clipboard
- 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