title: How to copy file from a Vagrant machine to localhost
body: <p>I want to copy a local file from a Vagrant machine to my <code>localhost</code>, but I am getting an error message:</p>
  
  <blockquote>
    <p>ssh: connect to host <code>127.0.0.1</code> port <code>22</code>: Connection refused.</p>
  </blockquote>
  
  <pre><code>[user@localhost ceil]$ scp -p 2222 vagrant@127.0.0.1:/home/vagrant/devstack/local.conf .
  cp: cannot stat ‘2222’: No such file or directory
  ssh: connect to host 127.0.0.1 port 22: Connection refused
  </code></pre>
  
  <p>I also tried using using <code>localhost</code> but still got the same error.</p>