Alex Rivera | Logout

wget and htaccess: username only

Asked 2012-01-12T19:36:10.523
10

I googled how to download images using terminal in ubuntu with wget. I found what I needed, but on the server, protected with .htaccess, there's no password. with

wget admin@http://server.com/filename.jpg

it returns: No route to hosts. When I set a password and type

wget admin:password@http://server.com/filename.jpg

everything's fine. However I am not allowed to use a password on the server. How to fix it, finding route?

Edit
Report

1 Answer

6

Try

wget --user=admin http://server.com/filename.jpg

instead.

Alternatively,

wget http://admin:@server.com/filename.jpg

may work instead.

Your syntax is actually wrong, as its:

wget http://user:pass@host/file

your username is outside the url, and was being treated as a hostname.

answered 2012-01-12T19:40:48.560

Your Answer