Mar 092010
 

I set up git on my FreeBSD box so that I can commit my code to GitHub. Today I tried to scp some stuff over and I was met with this rather unhelpful message:

vivin@serenity ~/Projects/code
$ scp -r vivin@www.vivin.net:~/code/agnostic .
Password:
ps: Process environment requires procfs(5)
Initializing new SSH agent...

vivin@serenity ~/Projects/code
$

I fixed the procfs problem by adding the following to my /etc/fstab:

proc                    /proc           procfs  rw              0       0
linproc                 /compat/linux/proc      linprocfs       rw      0       0

and then running:

vivin@enterprise ~
$ sudo mount /compat/linux/proc

vivin@enterprise ~
$ sudo mount /proc  

So I try to scp again and I get:

vivin@serenity ~/Projects/code
$ scp -r vivin@www.vivin.net:~/code/agnostic .
Password:
Initializing new SSH agent...

vivin@serenity ~/Projects/code
$

WTF? Then I remembered making some changes to my .bashrc to be able to commit to github:

function start_agent {
  echo "Initializing new SSH agent..."
  /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
  echo succeeded
  chmod 600 "${SSH_ENV}"
  . "${SSH_ENV}" > /dev/null
  /usr/bin/ssh-add;
}

# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
  . "${SSH_ENV}" > /dev/null
  #ps ${SSH_AGENT_PID} doesn't work under cywgin
  ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
    start_agent;
  }
else
  start_agent;
fi

I pulled all that out of my .bashrc and made a separate shell script for it. After I did that, scp started working again. I had no idea that calling scp would actually run .bashrc

  One Response to “GitHub broke my scp”

  1. Running scp won’t run .bashrc. Opening the terminal session (starting the bash shell) will.

Leave a Reply

All original content on these pages is fingerprinted and certified by Digiprove