Created
August 26, 2016 13:48
-
-
Save PieterScheffers/79f27ae6140b23aa586480a3bbefa831 to your computer and use it in GitHub Desktop.
ssh
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
# Basic login | |
#### authorized_keys on server | |
ssh-rsa...rest of local public key (.pub) | |
#### .ssh/config | |
Host some_server_alias # custom name of the host | |
HostName example.nl # hostname of the server | |
User some_user # user to login as | |
ForwardAgent yes # forward local keychain, so you can use bitbucket with local key | |
#### usage | |
ssh some_server_alias | |
# key forwarding and multiple bitbucket accounts | |
#### Create new key | |
ssh-keygen -t rsa -b 4096 -f ~/.ssh/somekey_id_rsa -c "some_unique_comment" | |
#### .ssh/config | |
Host some_server_alias | |
HostName example.nl | |
User some_user | |
ForwardAgent yes | |
PreferredAuthentications publickey | |
IdentityFile ~/.ssh/somekey_id_rsa | |
IdentitiesOnly yes | |
#### Login | |
##### Add to Script or alias | |
ssh some_server_alias -t "ssh-add -L | grep some_unique_comment > ~/.ssh/id_rsa.pub; cd some/other/folder; bash --login" | |
##### or server authorized_keys file | |
command="ssh-add -L | grep some_unique_comment > ~/.ssh/id_rsa.pub; cd some/other/folder; bash --login" ssh-rsa AA...rest of key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment