This is just another note-to-self post.
Wouldn't be nice to have your publickey stored in someplace where you can import it to .ssh/authorized_keys? Apparently github is a very convenient place for exactly that.
Wouldn't be nice to have your publickey stored in someplace where you can import it to .ssh/authorized_keys? Apparently github is a very convenient place for exactly that.
Generate your digital identity (source)
Luckily you only need to do this once.- In Git Bash (or your linux machine)
- ssh-keygen -t rsa -b 4096 -C "your_github_email@example.com
- Add the public key to github (source):
- Find your public key file. The default location is ~\.ssh\id_rsa.pub
- Go to https://github.com/settings/keys and add it ot your keys
- (optional, Windows & Putty only) Convert public key to putty format (source):
- Open puttygen, and:
- Click Conversions/Import key.
- Navigate to the OpenSSH private key and click Open.
- Under Actions / Save the generated key, select Save private key.
- Choose an optional passphrase to protect the private key.
- Save the private key as id_rsa.ppk.
- Open putty, and:
- In Session tab, load the config you want to change
- Open SSH/Auth, tab, Browse the id_rsa.ppk
- Back in the session tab, Save the config
Import the key on the server you are connecting
Yes, on all of them
- On your remote server, you can add the public key like this (tested on ubuntu server): ssh-import-id gh:<github_user_id>
Troubleshooting
(Putty only): make sure your client actually sends in the key. The ky file location stored with the saved session
On the remote server side:
chmod 700 ~/.ssh - to fix permission errors on the folder
chmod 600 ~/.ssh/authorized_keys - to fix permission errors on the file
Nincsenek megjegyzések:
Megjegyzés küldése