John Marsland
2005-Jun-30 10:10 UTC
[R] download.file() / install.packages() from a url with a username and password
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 at url.com. Any ideas? Regards, John Marsland
Prof Brian Ripley
2005-Jun-30 11:38 UTC
[R] download.file() / install.packages() from a url with a username and password
On Thu, 30 Jun 2005, John Marsland 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 at url.com. > > Any ideas?You need to use a method which supports this form of access. The basic internal method in R does not. It is likely that --internet2 on Windows does. method="wget" does. Since the internal method can handle authentication on proxies, it would not be hard to add this based on the existing code - patches are welcome. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Seth Falcon
2005-Jul-05 19:19 UTC
[R] download.file() / install.packages() from a url with a username and password
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 at 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