The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages here.

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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-26-2007
pranavagarwal pranavagarwal is offline
Registered User
  
 

Join Date: Oct 2007
Location: India
Posts: 29
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?
  #2 (permalink)  
Old 11-26-2007
porter porter is offline Forum Advisor  
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?
  #3 (permalink)  
Old 11-27-2007
pranavagarwal pranavagarwal is offline
Registered User
  
 

Join Date: Oct 2007
Location: India
Posts: 29
@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?
  #4 (permalink)  
Old 11-27-2007
porter porter is offline Forum Advisor  
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.
  #5 (permalink)  
Old 11-27-2007
pranavagarwal pranavagarwal is offline
Registered User
  
 

Join Date: Oct 2007
Location: India
Posts: 29
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 12:10 PM.. Reason: Confirmation
  #6 (permalink)  
Old 11-27-2007
porter porter is offline Forum Advisor  
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.
  #7 (permalink)  
Old 11-27-2007
pranavagarwal pranavagarwal is offline
Registered User
  
 

Join Date: Oct 2007
Location: India
Posts: 29
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.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




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


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0