0

I would like to wget a file from an http server like:

wget --no-check-certificate --http-user=<username> --http-passwd=<passwd> https://<file_path>

  1. What are the initial ssh setup required?
  2. What do i update in the know_hosts on the remote system?
  3. Is a restart reuired?
dportman
  • 1,101
  • 10
  • 20
vidya
  • 79
  • 1
  • 3
  • 7
  • Possible duplicate of [wget command to download a file and save as a different filename](https://stackoverflow.com/questions/16678487/wget-command-to-download-a-file-and-save-as-a-different-filename) – Mohammad Azim May 11 '18 at 14:40
  • As far as I know wget uses http and does not require any ssh setup. Is the server is public domain? An example may ease to find exact arguments to wget. – Mohammad Azim May 11 '18 at 14:37

2 Answers2

2
1. What are the initial ssh setup required? 

You do not need ssh setup to be able to use wget. If you are on linux, it should be built-in. You can confirm that by typing :

$ type wget

If you get a response like

wget is /usr/local/bin/wget

you are good to go. No setup needed.

2. What do i update in the know_hosts on the remote system? 

Nothing again, that file is specific to ssh. Leave it alone.

3. Is a restart reuired?

No, not even if you were to install wget.

Gautam
  • 1,862
  • 9
  • 16
1

You will need to do two things:

  1. Install Apache on your Ubuntu installations. The command to use is sudo apt-get install apache2.
  2. Copy or move your file.conf to the folder at /var/www. You might need to use sudo for this again: for example, sudo cp /path/to/your/file.conf /var/www/file.conf.

wget will probably not work with wildcards. A better solution will be to do something like this as a shell script, once all your configuration files are accessible:

#!/bin/bash

for i in {1..100}

do

wget "127.0.$i.1"

done

another solution

note wget will only be able to download anything if there is an HTTP server running at the other end.

s you may be able to run commands via ssh in bulk, this might help:

# on the client machine:
cd /home/username/Pictures/
python -m SimpleHTTPServer

This starts a web-server on the machine it's run on. You can then access the file from anywhere using

wget http://172.29.34.15:8000/x.jpeg
  • Though i provide correct passwd and username i get the error "HTTP request sent, awaiting response... 401 Unauthorized Authentication selected: Basic realm="Intranet ID and Password" Reusing existing connection to HTTP request sent, awaiting response... 401 Unauthorized Username/Password Authentication Failed." – vidya May 11 '18 at 16:00