Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

migrated from unix.stackexchange.com Jan 27 '13 at 8:15

This question came from our site for users of Linux, FreeBSD and other Un*x-like operating systems..

    
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 Super User (do not repost). –  Gilles Jan 26 '13 at 22:31
add comment

1 Answer 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:

share|improve this answer
    
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 Jan 26 '13 at 10:24
    
@ChrisDown Please show references! Or take a look at google.com/search?q=sftp or en.wikipedia.org/wiki/SSH_File_Transfer_Protocol –  F. Hauri Jan 26 '13 at 11:59
    
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 Jan 26 '13 at 13:26
1  
@EightBitTony Question stand for SFTP, talk about .ssh/ and id_rsa.pub. This concern SSH FTP. –  F. Hauri Jan 26 '13 at 13:54
    
FreFTPd advertises itself as an SFTP server, so there should be no need to install anything else on Windows. –  Gilles Jan 26 '13 at 22:29
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.