I've tried to connect to a server via wget:
wget http://<user>:<pass>@serveradress
But wget responds: invalid port
I know that the server accepts incoming traffic at port 80. How can I fix this issue?
I've tried to connect to a server via wget:
wget http://<user>:<pass>@serveradress
But wget responds: invalid port
I know that the server accepts incoming traffic at port 80. How can I fix this issue?
Wget interprets
<pass>@serveraddress
as port. To specify a username and password, use the--user
and--password
switches:From
man wget
:You have 3 options here. They are in no specific order other than gut feeling:
1. Password is visible to anyone (using the command
history
)The password will also be visible in
ps
,top
,htop
and similar.2. Password is visible to anyone looking behind your shoulders
Notice the white space before the command, it prevents saving it to your history.
The password will also be visible in
ps
,top
,htop
and similar. (Thanks user412812)3. Password is not visible to anyone including you
Then you're asked for the password
You can also store the username and password in the file
~/.wgetrc
and change the permissions of that file so that only your user can read it:File
~/.wgetrc
:... and then
Note, however, that user
root
can still peek into that file and read the password.From the manpage:
This should work (don't miss the quotes)
Example for my access to the builds on ftp server
You can provide authentication credential via
--user=USERNAME
and--password=PASSWORD
; based on theman wget
, the command can be overridden using the--http-user=USERNAME
and--http-password=PASSWORD
for http connection and the--ftp-use=USERNAME
and--ftp-password=PASSWORD
for ftp connection.The command could have used
--http-user
and--http-password
instead of--user
and--password
. In case offtp
request the options are--ftp-user
and--ftp-password
.