DEV Community

Cover image for SSH
Iannetta
Iannetta

Posted on

SSH

Articles

A visual guide to SSH tunnels: Local and Remote Port Forwarding


Usefull links

Generating a new SSH key and adding it to the ssh-agent


Cheat Sheet

Generate SSH key pair

Generate ssh key pair ed25519

ssh-keygen -t ed25519 -C "your_email@example.com"
Enter fullscreen mode Exit fullscreen mode

Will ask for the location to save the key (default ~/.ssh/id_ed25519), password, and confirm the password.


Generated two keys
Private: ~/.ssh/id_ed25519

cat ~/.ssh/id_ed25519
Enter fullscreen mode Exit fullscreen mode

output

-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACAF9+5BkCMDAJ84w+WlhU9glZKU12sXRzW+Hj1pElaz7gAAAKCzsjUts7I1
LQAAAAtzc2gtZWQyNTUxOQAAACAF9+5BkCMDAJ84w+WlhU9glZKU12sXRzW+Hj1pElaz7g
AAAEAjwc/egakGFdlhXxU2WK15Dtu1fnguQwQQKdCDwJWPuQX37kGQIwMAnzjD5aWFT2CV
kpTXaxdHNb4ePWkSVrPuAAAAFnlvdXJfZW1haWxAZXhhbXBsZS5jb20BAgMEBQYH
-----END OPENSSH PRIVATE KEY-----
Enter fullscreen mode Exit fullscreen mode

public: ~/.ssh/id_ed25519.pub

cat ~/.ssh/id_ed25519.pub
Enter fullscreen mode Exit fullscreen mode

The private key (id_ed25519) never is expose, never send to anyone, In services such as github or gitlab, use to a public key (id_ed25519.pub).

Top comments (0)