FTP from Linux to Windows server

0

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.

m4n07

Posted 2013-01-26T07:31:10.480

Reputation: 111

Your question is about FreeFTPd, which is a Windows program. The problem isn't making Linux interact with Windows, but about making Windows support a non-Unix-specific network protocol. So it is off-topic here. I've flagged it for migration to [su] (do not repost). – Gilles 'SO- stop being evil' – 2013-01-26T22:31:48.267

Answers

1

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:

F. Hauri

Posted 2013-01-26T07:31:10.480

Reputation: 1 394

Actually, "secure FTP" is a standard way of referencing the SFTP protocol. SFTP is not FTP, but SFTP is also not SSH (it is an IETF extension). – Chris Down – 2013-01-26T10:24:56.503

@ChrisDown Please show references! Or take a look at http://www.google.com/search?q=sftp or http://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol

– F. Hauri – 2013-01-26T11:59:42.703

FTP, SFTP (file transfer over SSH), and FTPS (Secure FTP) are all different. In other words, the answer here is correct if the OP is talking about SFTP and not getting confused with Secure FTP (FTPS). – EightBitTony – 2013-01-26T13:26:00.597

1@EightBitTony Question stand for SFTP, talk about .ssh/ and id_rsa.pub. This concern SSH FTP. – F. Hauri – 2013-01-26T13:54:40.753

FreFTPd advertises itself as an SFTP server, so there should be no need to install anything else on Windows.

– Gilles 'SO- stop being evil' – 2013-01-26T22:29:56.960

@Gilles Yes, if it does the job... I don't know, as FreeFTPd seem not to be open source and as I could say same in the other way: basic OpenSSH could does the job as full featured sftpserver*. – F. Hauri – 2013-01-27T03:58:00.337

@F.Hauri - From the article you just linked to: "In computing, the SSH File Transfer Protocol (also [...] Secure FTP)" – Chris Down – 2013-01-27T06:33:38.207

@ChrisDown Yes, I've pasted this in one of first edit after your post. SSH FTP could be called Secure FTP but it's SSH anyway!!! – F. Hauri – 2013-01-27T08:40:51.327

I'm trying to figure out a way to get - password less login from a script using key based authentication. Can you please help me in this regard. Thanks – m4n07 – 2013-01-27T10:53:20.063

@m4n07 Did you already tried to install cygwin and openssh? I don't know FreeFTPd. Maybe in the FreeFTPd's FAQ would you find something. – F. Hauri – 2013-01-27T10:58:40.647