SFTP files from one server to another

Hi,

I want to transfer files from 1 server to another server using sftp.
Earlier what I use to do is transfer files on the same server using mv command.

Pls help.

You need to sync the host keys and user keys(which ever user) for using sftp without password.
You need not sync the keys if you dont want a passwordless sftp.

regards,
Ahamed

Thanks. I dont need a passwordless sftp. How shall I transfer files to remote server using sftp then??

sftp user@host
eg:-

sftp root@192.168.1.1

It will prompt for password, provide the password and use the normal ftp commands to transfer the files like put etc

regards,
Ahamed

I did this but it gives and error :-
"Couldn't read packet: Connection reset by peer" :frowning:

On the remote server, check if ssh daemon is running. ps -eaf | grep ssh
Hope your host is reachable.

regards,
Ahamed

Actually I want to transfer files on a specific sftp server. The command that I'm trying to move files is as follows:-
<CODE>
scp user@server:/var/path/XX_P.txt sftp -oPort=22 user@server:/dir
</CODE>
Is this the right way to do it? else how can this be achieved??

Pls help.

Chetan

---------- Post updated 08-04-11 at 12:30 PM ---------- Previous update was 08-03-11 at 02:33 PM ----------

Can someone let me know if there is any other way of passing passwords to scp other than sharing public and private key concept???