title: RCurl - How to retrieve data from sftp?
body: <p>I tried to retrieve data from sftp with the below code:</p>
  
  <pre><code>library(RCurl)
  
  protocol &lt;- "sftp"
  server &lt;- "xxxx@sftp.xxxx.com"
  userpwd &lt;- "xxx:yyy"
  tsfrFilename &lt;- "cccccc.tsv" 
  ouptFilename &lt;- "out.csv"
  
  
  
  opts = list(
    #ssh.public.keyfile = "true", # file name
    ssh.private.keyfile = "xxxxx.ppk",
    keypasswd = "userpwd"
  )
  
  # Run #
  ## Download Data
  url &lt;- paste0(protocol, "://", server, tsfrFilename)
  data &lt;- getURL(url = url, .opts = opts, userpwd=userpwd)
  </code></pre>
  
  <p>and i received an error message: 
  Error in function (type, msg, asError = TRUE)  : Authentication failure</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Thanks</p>