[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-wget] Using wget in a script run by sudo

From: Dan Rabb
Subject: [Bug-wget] Using wget in a script run by sudo
Date: Wed, 5 Jun 2013 14:26:19 -0700 (PDT)

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). 

Dan Rabb 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]