[R] download.file() / install.packages() from a url with a username and password

Seth Falcon sfalcon at fhcrc.org
Tue Jul 5 21:19:43 CEST 2005

On 30 Jun 2005, john.marsland at wmgfunds.com wrote:

> I am trying to create a repository for my own packages as an easy
> way to auto install packages on a number of servers.
> Obviously, I am able to connect using install.packages() to CRAN  
> without problems but when I specify my own repos I get an error:
>> install.packages(pkgs, repos="http://some.site.com")
> Warnings message:
> cannot open: HTTP status was '401 Authorisation Required'
> I get a similar message if I try to use download.file() on the  
> PACKAGES file.
> I have tried the url in the form http://username:password@url.com.
> Any ideas?

Are you expecting your webserver to require authentication?  If not,
well, I think you have a server config issue.

Assuming you have configured authentication, I suspect it will be
difficult to get install.packages to play along.  

Perhaps there is another way you can protect the site.  For example,
only allow local connections and then use ssh port forwarding to
connect to the site from "outside".

+ seth

More information about the R-help mailing list