Git Bash for Windows

Over past few years I have been using Git-Bash for remote SSH access to remote Linux servers. I prefer this over Putty for it light weight and integrates into GIT well, with minimal setup.

Though this does require ssh_agent running at the starts. We can start the ssh_agent automatically after reboot of the PC for the first time using start_ssh_agent script in .bashrc.

Following code can be included in .bashrc, to set the environment up.

# Start SSH Agent


function run_ssh_env {
  . "${SSH_ENV}" > /dev/null

function start_ssh_agent {
  echo "Initializing new SSH agent..."
  ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
  echo "succeeded"
  chmod 600 "${SSH_ENV}"


  ssh-add ~/.ssh/id_rsa;

if [ -f "${SSH_ENV}" ]; then
  ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {

Once this is setup, all ssh commands works great.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s