Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wget and htaccess: username only

Tags:

linux

wget

ubuntu

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?

like image 596
Emil Avramov Avatar asked Jan 12 '12 19:01

Emil Avramov


2 Answers

Much easier:

wget --user="username" --password="password" http://xxxx.yy/filename.xxx
like image 199
Andrea Puiatti Avatar answered Sep 30 '22 05:09

Andrea Puiatti


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.

like image 37
Marc B Avatar answered Sep 30 '22 05:09

Marc B