Windows – FTP from Linux to Windows server

sftpwindows

I'm writing a script to do a sftp to Windows (Server) from a Linux machine. I wanted the script to run without manual inputs like inputting password etc.

#!/bin/sh
HOST='10.x.x.x'
USER='user'
PASSWD='passwd'

sftp $USER@$HOST

I'm using freeftpd as a SFTP server on the Windows machine. From the Linux end as of now I'm using Ubuntu but my actual requirement will be for a stripped down version of Linux for an ARM based machine.

From the Linux machine I'm generating public and private keys using ssh-keygen -t rsa. Two files (public and private) get generated under the /home/user/.ssh directory, i.e. id_rsa and id_rsa.pub.

If its another Linux machine I'm aware that I have to append the public key (id_rsa.pub) to the authorized_keys file.

I'm not sure now, since my SFTP server is on Windows. After installing freeFTPd I checked in C:\Program Files\freeFTPd\ , but I dont see any files resembling .ssh/authorized_keys as in Linux.

FreeFTPd has the option to generate a private key. So I generated one and copied the same to the Linux machine (.ssh/id_rsa) file and tried . But it still prompts for password.

How can I solve this.

Best Answer

I don't know Windows, but you seem wrong in that:

  • SFTP don't mean Securised implementation of simple FTP protocol but SSH File Transfert Protocol so the server needed don't have to answer FTP protocol, but SSH! (From wikipedia:)

    SSH File Transfer Protocol

    From Wikipedia, the free encyclopedia
    Jump to: navigation, search
    Not to be confused with Simple File Transfer Protocol.
    In computing, the SSH File Transfer Protocol (also Secure File Transfer Protocol, Secure FTP, or SFTP) is a network protocol that provides file access, file transfer, and file management functionalities over any reliable data stream. It was designed by the Internet Engineering Task Force (IETF) as an extension of the Secure Shell protocol (SSH) version 2.0 to provide secure file transfer capability...

So you have to install a SSH Server on your windows.

Take a look at:

Related Question