get files with wget and SFTP [closed]

2019-02-24 11:26发布

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:password@adress.ip.of.server/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 ! :)

标签: linux wget sftp
1条回答
一纸荒年 Trace。
2楼-- · 2019-02-24 12:24

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.

查看更多
登录 后发表回答