The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > SUN Solaris
Google UNIX.COM


SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to connect sftp server using script kittusri9 Shell Programming and Scripting 1 05-06-2008 04:12 AM
How to set up a home SFTP server? verrock_poo UNIX Desktop for Dummies Questions & Answers 1 02-09-2008 02:23 PM
SFTP from windows E:/ to unix server pranavagarwal Shell Programming and Scripting 12 11-28-2007 06:58 AM
SFTP file from unix box to a NT server queenie680 UNIX for Dummies Questions & Answers 5 11-12-2007 02:41 PM
How to add SFTP KEY to UAT SERVER? jingi1234 UNIX for Dummies Questions & Answers 0 05-20-2005 02:25 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-13-2008
Registered User
 

Join Date: Feb 2008
Posts: 77
Stumble this Post!
i want to sftp to a server

Hi all,
I want to sftp to a server called serverB. I want to do it via a running a script. The code i have written is that..

sftp -v x.x.x.x << EOF
user username password
cd dir1
bin
mget *
bye
EOF

But it is not at all working and even it is asking for password. Can any one help me regarding this.

Thank U
Naree
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-13-2008
Registered User
 

Join Date: Nov 2001
Location: Flint, MI
Posts: 172
Stumble this Post!
If you do a search of these forums on sftp you will find many postings on this subject. You can only use sftp in interactive mode. For scripting you might try using expect.
Reply With Quote
  #3 (permalink)  
Old 03-13-2008
Registered User
 

Join Date: Mar 2008
Posts: 10
Stumble this Post!
Another option would be if you are getting the entire contents of the directory, like in your example, is just to do an scp -r on that directory. Then you would get it all and it a one line command and easily scriptable. Also better to set up pub/priv keys for SSH too instead of putting the user name and password in the script.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:28 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0