SFTP files from one server to another | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

SFTP files from one server to another

Shell Programming and Scripting


Tags
ftp, mv

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-03-2011
chetancrsp18 chetancrsp18 is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 10 August 2011, 8:08 AM EDT
Posts: 25
Thanks: 7
Thanked 0 Times in 0 Posts
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.
Sponsored Links
    #2  
Old 08-03-2011
ahamed101's Avatar
ahamed101 ahamed101 is offline Forum Advisor  
root is god!!!
 
Join Date: Sep 2008
Last Activity: 31 October 2014, 5:13 AM EDT
Location: San Jose, CA
Posts: 1,910
Thanks: 54
Thanked 486 Times in 479 Posts
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
Sponsored Links
    #3  
Old 08-03-2011
chetancrsp18 chetancrsp18 is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 10 August 2011, 8:08 AM EDT
Posts: 25
Thanks: 7
Thanked 0 Times in 0 Posts
Thanks. I dont need a passwordless sftp. How shall I transfer files to remote server using sftp then??
    #4  
Old 08-03-2011
ahamed101's Avatar
ahamed101 ahamed101 is offline Forum Advisor  
root is god!!!
 
Join Date: Sep 2008
Last Activity: 31 October 2014, 5:13 AM EDT
Location: San Jose, CA
Posts: 1,910
Thanks: 54
Thanked 486 Times in 479 Posts

Code:
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
Sponsored Links
    #5  
Old 08-03-2011
chetancrsp18 chetancrsp18 is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 10 August 2011, 8:08 AM EDT
Posts: 25
Thanks: 7
Thanked 0 Times in 0 Posts
I did this but it gives and error :-
"Couldn't read packet: Connection reset by peer"
Sponsored Links
    #6  
Old 08-03-2011
ahamed101's Avatar
ahamed101 ahamed101 is offline Forum Advisor  
root is god!!!
 
Join Date: Sep 2008
Last Activity: 31 October 2014, 5:13 AM EDT
Location: San Jose, CA
Posts: 1,910
Thanks: 54
Thanked 486 Times in 479 Posts
On the remote server, check if ssh daemon is running. ps -eaf | grep ssh
Hope your host is reachable.

regards,
Ahamed
Sponsored Links
    #7  
Old 08-04-2011
chetancrsp18 chetancrsp18 is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 10 August 2011, 8:08 AM EDT
Posts: 25
Thanks: 7
Thanked 0 Times in 0 Posts
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???
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SFTP to transfer files from one server to another urfrnddpk Shell Programming and Scripting 1 04-21-2011 12:14 PM
Error copying files from Unix (Solaris10) to Windows Server 2003 using scp/sftp ajaykumarb Shell Programming and Scripting 0 07-21-2010 08:44 AM
File Missing When Grabbing Files from SFTP Server using SCP Command gingervitus UNIX for Dummies Questions & Answers 1 12-24-2008 09:35 AM
how to get multiple files using sftp from a windows server ramky79 Solaris 3 12-10-2008 07:47 PM
How to add SFTP KEY to UAT SERVER? jingi1234 UNIX for Dummies Questions & Answers 0 05-20-2005 05:25 PM



All times are GMT -4. The time now is 07:42 PM.