- LINUX (ubuntu)
- Generate key pair
- run "ssh-keygen -b 4096" in terminal
- -b flag assigns number of bits used to create the keys
- Prompts to create default names "id_rsa" and "id_rsa.pub"
- ensure these names do not already exist in the "~/.shh" folder as will be overwritten
- id_rsa is the private key
- id_rsa.pub is the public key
- Enter a passphrase (optional)
- if not used, authentication will not include any prompts
- Upload Public Key to Linode
- run "ssh-copy-id {username@serverIPaddress}
- enter account password when prompted
- login via "ssh username@ipaddress" to test connection
- all public keys are added to "~/.ssh/authorized_keys" file
- Can also load public key manually:
- copy all text in "id-rsa.pub" key
- create "~/.ssh" folder and "authorized_keys" file if required and apply permissions (700 & 600 respectively)
- open "authorized_keys" file with text editor and paste contents on a new line at bottom
- WINDOWS
- Generate key pair with PuTTY
- download PuTTY which included PuTTYgen program
- run puttygen and select RSA (or ECDSA/EC25519) with 4096 bits
- click on "Generate"
- puttygen uses random input from mouse to create keys so move mouse
- Paste the displayed public key into notepad and save as .txt (not rtf or doc)
- add passphrase in field if required
- click on "Save Private Key" and select name and path (keeping .ppk extension)
- use different names if keeping multiple key pairs for different servers
- Copy SSH key with PuTTY
- launch PuTTY > Category > Connection > SSH >AUTH
- click "Browse" to enter path to saved private key
- go to Category/session and save IP address in new session name
- establish a session and login to remote server
- create "~/.ssh" folder and "authorized_keys" file if required and apply permissions (700 & 600 respectively)
- open "authorized_keys" file with text editor and paste previous copy of public key contents on a new line at bottom