Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in setting up .SSH keys with Windows PowerShell

I've got the GIT BASH shell working correctly with SSH keys, so I know my basic configuration steps are correct, but I prefer the windows powershell (actually I prefer the Mac or Linux terminal, but out of the available options...)

Anyways.

My windows powershell is set up with the PS1 script fount in this blog post http://markembling.info/2009/09/ssh-agent-in-powershell and from what I can tell, the start up is running correctly

Starting SSH agent...
SSH agent PID: 5064

But when I try to SSH in or run git commands from powershell, I'm still prompted for a password. Has anyone seen this before? I prefer PS to Git Bash but will stick with it in the worst case.

EDIT - Answer provided by VonC = Add %HOME% to windows system environment variables

To view or change environment variables:

Right-click My Computer, and then click Properties.
Click the Advanced tab.
Click Environment variables.
Click one the following options, under user variables:
    Click New 
         variable name `HOME` (No quotes, or percentage signs) 
         value: C:\Documents and Settings\**your username**
            or: C:\Users\**your username** 

Restart powershell (or whatever shell you love) and your SSH works by default.

like image 716
Alex C Avatar asked Oct 27 '25 00:10

Alex C


1 Answers

The first element to check is the value of the environment variable %HOME%.
It might be naturally set in a bash session, but in a Windows (here PowerShell) session, it is not defined by default.

It is best to defined that variable at the "User Environment Variables" level, for all shells to inherit from it.

like image 67
VonC Avatar answered Oct 29 '25 16:10

VonC