0

I use a password-protected ssh key (RSA). That means that I need to type the password to decipher the key before using it.

I noticed that on some computers, I don't need to type the pass of my ssh key each time I need to use it.

On my Windows computer, as well as some Linux servers, I need to do it.

I use OpenSSH on Windows (not Putty), so it is the same key as Linux. Stored in the /.shh directory.

Having a password-protected key is good in case someone steals it. But typing the password each time is annoying.

Is there a way to have my computers, on Windows and Linux, remember it?

I use it from the shell (default Ubuntu terminal and PowerShell, often from VS Code).

Thanks

I tried this, but no success:

(base) PS C:\code> ssh-add -k C:\Users\user\.ssh\id_rsa  
Enter passphrase for C:\Users\user\.ssh\id_rsa: 
Identity added: C:\Users\user\.ssh\id_rsa (C:\Users\user\.ssh\id_rsa)
(base) PS C:\code> git fetch
Enter passphrase for key '/c/Users/user/.ssh/id_rsa': 

Xiiryo
  • 3,021
  • 5
  • 31
  • 48

1 Answers1

0

ssh-agent is the process that keeps your passphrase after the initial unlocking, so you don't need to type it every time

Linux Basic Tutorial on ssh-agent

Windows SSH documentation

Git Bash for Windows documentation

Josiah Yoder
  • 3,321
  • 4
  • 40
  • 58
namizaru
  • 646
  • 3
  • 5
  • I have moved this question to https://superuser.com/questions/1750783/how-do-you-avoid-typing-the-password-of-your-ssh-key-each-time-on-linux-and-win. Please consider moving your answer there. Please also @mention me here so I can upvote your answer there. Then it's probably best to delete this answer. – Josiah Yoder Nov 02 '22 at 17:41