The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Passwordless sftp from UNIX to windows site konark Shell Programming and Scripting 2 03-24-2008 10:36 AM
how to get multiple files using sftp from a windows server ramky79 SUN Solaris 0 03-02-2008 10:15 AM
SFTP files from windows drive E: to unix pranavagarwal UNIX for Dummies Questions & Answers 4 11-26-2007 05:17 AM
SFTP file from unix box to a NT server queenie680 UNIX for Dummies Questions & Answers 5 11-12-2007 02:41 PM
SFTP from UNIX (AIX) to Windows 2000 server reddymails Shell Programming and Scripting 0 03-09-2006 05:15 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-26-2007
Registered User
 

Join Date: Oct 2007
Location: India
Posts: 24
Exclamation SFTP from windows E:/ to unix server

Hello All ,

I am making a script in the ksh to Secure FTP a set of files from the E:/ drive in windows a computer to a unix server.

Had it been in the unix directory, I could have used the expect utility to use the non-interactive mode for sftp,

Code:
#!/usr/local/bin/expect
#!/bin/ksh

spawn sftp -b user@11.11.11
expect "password:"
send "password"

cd /export/home/direc1
lcd /home/direc2

ascii

get new1
quit
or used public key encryption.

But, the file is in the windows directory. How do I get that file?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 11-26-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by pranavagarwal View Post
How do I get that file?
Do you have an sshd or sftp server on the Windows machine?
Reply With Quote
  #3 (permalink)  
Old 11-26-2007
Registered User
 

Join Date: Oct 2007
Location: India
Posts: 24
@porter

of course it has. It actually is a unix server machine on which the windows is also installed.

Do we need a separate sftp installation on the windows OS?
Reply With Quote
  #4 (permalink)  
Old 11-26-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by pranavagarwal View Post
of course it has. It actually is a unix server machine on which the windows is also installed.
How were we supposed to know that if you did not tell us. You post suggested it was a windows machine.

Quote:
Originally Posted by pranavagarwal View Post
Do we need a separate sftp installation on the windows OS?
What environment is this "Windows OS" running in?

How are the file systems mapped between Windows and UNIX?

We know very little about your environment unless you tell us.
Reply With Quote
  #5 (permalink)  
Old 11-27-2007
Registered User
 

Join Date: Oct 2007
Location: India
Posts: 24
Arrow sorry for the delay in reply...

Quote:
Originally Posted by porter View Post
What environment is this "Windows OS" running in?

How are the file systems mapped between Windows and UNIX?

We know very little about your environment unless you tell us.
I am not very sure of how the system is mapped. In fact, it is very possible that there is no unix installation in it. It could be a Windows only server.
The login credentials I have, have been configured for ftp connectivity.

So?

I can still help you with some more info..

Code:
/export/home/pranav> ftp -inv
ftp> open hostname
Connected to hostname.
ftp> user username P@ssword
331 Password required
230 user logged in
ftp> pwd
257 "/" is current directory
ftp> ls
200 command successful
150 Opening ASCII data connection for directory listing
Listen
acd01jax.itf
ACD01PHL.itf
ACD01PHL.OLD
Listen_configuration.ini
Stream1
Stream10
Stream11
Stream12
Stream13
Stream14
Stream15
Stream16
Stream17
Stream18
Stream19
Stream2
Stream20
Stream21
Stream22
Stream23
Stream24
Stream25
Stream26
Stream27
Stream28
Stream29
Stream3
Stream30
Stream31
Stream32
Stream33
Stream4
Stream5
Stream6
Stream7
Stream8
Stream9
xx.xx
226 transfer complete
This is what i was able to do with the connection.

I don't understand the output of 'ls'. If anybody can throw some light on where is this '/' that i get with 'pwd'.

Any ideas will be appreciated.
thanx

Edit: I confirm here that there is no unix installation on the remote server.

Last edited by pranavagarwal; 11-27-2007 at 08:10 AM. Reason: Confirmation
Reply With Quote
  #6 (permalink)  
Old 11-27-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by pranavagarwal View Post
I don't understand the output of 'ls'. If anybody can throw some light on where is this '/' that i get with 'pwd'.
Logon onto the Windows box and either

(a) do a file search for some of the name files given in the listing.

(b) go to the control panel and find the panel that configures the ftp server.

and also you are using "ftp", not "sftp" as you mentioned in your original post.
Reply With Quote
  #7 (permalink)  
Old 11-27-2007
Registered User
 

Join Date: Oct 2007
Location: India
Posts: 24
Thumbs up

Well, will try this and get back here soon.
Good Day!

Quote:
Originally Posted by porter View Post
and also you are using "ftp", not "sftp" as you mentioned in your original post.
I showed ftp here just for simplicity's sake.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:21 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