# wget with ssh socks

## Eagle_

Dear gentoo users,

The big picture:

- I would like my computer to connect a ftp server, every 1h, and download from there the files i don't have on my computer.

- The ftp server is behind a firewall and i was tolled i need to define in my socks.conf the following:

```
route {

        from: 0.0.0.0/0   to: 0.0.0.0/0   via: 127.0.0.1 port = 12345

        protocol: tcp                    # server supports tcp and udp.

        proxyprotocol: socks_v4 socks_v5 # server supports socks v4 and v5.

}
```

which i did.

- I need to open a ssh tunnel to the router:

```
ssh -l USERNAME -D 12345 123.123.123.123
```

What i did so far:

- I decided to use wget (after using the ssh above and using the command bellow, everything works fine):

```
socksify wget --user=USERNAME --password=PASSWORD -r -cN --directory-prefix=/usr/local/downloads/ ftp://192.168.80.149/
```

- To my /etc/crontab i added the line:

```
0 * * * *      root    socksify wget --user=USERNAME --password=PASSWORD -r -cN --directory-prefix=/usr/local/downloads ftp://192.168.80.149
```

My questions:

I would like to know if i could open the socks tunnel simply with wget, with out the need of using ssh.

If this is not possible or someone have a better idea, i would like to know how could i cron automatically to open the ssh tunnel and downloading the files with wget or another tool.

Thanks

----------

## Hu

This sounds like the perfect job for rsync.  If you can influence the server, you may be better off setting up an rsyncd on it.

You could use public key authentication to allow ssh to connect to the remote system in an unattended manner.  However, you would need to store the public key unencrypted on your system, which could be a security risk if someone can gain access to your filesystem.

There is native SOCKS5 support in net-misc/wget which would remove the need to use socksify.

----------

## Eagle_

Unfortunately my device doesn't support rsync... only simple ftp and i can also use telnet

----------

## Eagle_

I looked at http://www.gnu.org/software/wget/manual/wget.html but i haven't found how to use native socks options in net-misc/wget.

Maybe it is because i am not specialist in networks   :Sad: 

I hope someone who knows could tell me where to search this or write how to configure wget

Thanks

----------

