Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get files with wget and SFTP [closed]

Tags:

linux

wget

sftp

Hello guys...

I have a script running every night on a linux server, which intend to get files from another one using wget and ftp protocol. These files are located under a folder that can't be accessed through HTTP.

Here's the command line used :

wget --directory-prefix=localFolder ftp://login:[email protected]/path/*

The site access has been changed to SFTP. I would like to modify the script to be able to get the files just as it was doing before, but don't manage to do this with SFTP.

I tried to generate a secure key using ssh-keygen and then copy it to the server I wanted to access, but it didn't make it, or I just don't succeed to find the right way to do it...

Thanks ahead for your help ! :)

like image 584
Jeremy Belolo Avatar asked Dec 25 '12 15:12

Jeremy Belolo


1 Answers

To copy keys, I find that ssh-copy-id user@machine does all you need. As long as you have a key on your machine that is.

I also use scp quite a bit, where you specify scp user@machine:filespec whereto (it is using the same encryption and authentication mechanism as sftp).

Hope this helps.

like image 149
Mats Petersson Avatar answered Oct 12 '22 15:10

Mats Petersson