I have a wget command inside a script, which is executed with sudo 
[scriptname.sh]. The wget command is: 
wget --quiet --user=$REALUSER --password=$PASSWORD $link 

The script kept bombing out because the file that it's supposed to download, 
wasn't there. I removed the --quiet and added a '-o' and got the following: 
wget --user=[my actual username]: permission denied 

So, armed with that information, I played around outside the script and found 
out that if I execute: 
wget --user=[user] --password=[password] [link] 
The download completes successfully. However, if I try: 
sudo wget --user=[user] --password=[password] [link] 
I get the permission denied error. 

Is this by design? Does wget now allow you to specify and user other than $USER 
(in the sudo case, $USER=root). 

Thanks, 
Dan Rabb 

Reply via email to