SFTP from windows E:/ to unix server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SFTP from windows E:/ to unix server
# 1  
Old 11-26-2007
Error SFTP from windows E:/ to unix server

Hello All Smilie,

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  
Old 11-26-2007
Quote:
Originally Posted by pranavagarwal
How do I get that file?
Do you have an sshd or sftp server on the Windows machine?
# 3  
Old 11-27-2007
@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  
Old 11-27-2007
Quote:
Originally Posted by pranavagarwal
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
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  
Old 11-27-2007
CPU & Memory sorry for the delay in reply...

Quote:
Originally Posted by porter
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  
Old 11-27-2007
Quote:
Originally Posted by pranavagarwal
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  
Old 11-27-2007
MySQL

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

Quote:
Originally Posted by porter
and also you are using "ftp", not "sftp" as you mentioned in your original post.
I showed ftp here just for simplicity's sake.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Passwordless sftp connection from UNIX to windows server

HI , I am trying to make a passwordless sftp connection from a unix server to windows server I have used a existing script which is like this cd /home150/adm/.ssh/ ssh-agent /usr/bin/ksh <<EOF ssh-add IDBNEWKEY ssh-add -l sftp IDBUSER@abc.com cd /home/IDBUSER/Share/IDB/ rm ${FILE}... (0 Replies)
Discussion started by: Jcpratap
0 Replies

2. Shell Programming and Scripting

Needed SFTP script from windows to UNIX server and from UNIX to windows server(reverse SFTP)

hi guys, i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not and again i have to reverse sftp the files from unix to windows server..... regards, Vasa Saikumar. (13 Replies)
Discussion started by: hemanthsaikumar
13 Replies

3. IP Networking

How to transfer files from UNIX server to windows machine or vice versa using ftp or sftp commands?

hi, i want to write a shell script code which transfers files from a directory in unix server to a directory in a windows machine.. can any1 give me a sample code which uses ftp or sftp command.. thanks very much, (3 Replies)
Discussion started by: Little
3 Replies

4. Shell Programming and Scripting

Sftp some files from windows server to UNIX server

hi i need to transfer some files from windows server to unix server using SFTP. but before transferring the files, i need to check the existence of a particular file in the remote directory (say r_dir1). if the file is present, then SFTP all the files. after SFTPing the files from the remote... (1 Reply)
Discussion started by: vinit raj
1 Replies

5. Shell Programming and Scripting

Unix shell script to Copy files from one Windows server to another Windows server.

Can anybody please help me on how to code for the below requirement: I need to write a shell script (on different unix server) to copy files from multiple folders (ex. BRN-000001) from one windows server (\\boldls-mwe-dev4)to a different windows server(\\rrwin-ewhd04.ecomad.int). This shell... (4 Replies)
Discussion started by: SravsJaya
4 Replies

6. Shell Programming and Scripting

Error copying files from Unix (Solaris10) to Windows Server 2003 using scp/sftp

Hi, I have generated a Public/Private Key Pair in Solaris Unix (source) server and deployed the Public key in Windows 2003(target) server .ssh directory of user profile. When i try to connect(ssh, scp, sftp) from Unix, i'm getting below error message. Sun_SSH_1.1, SSH protocols 1.5/2.0,... (0 Replies)
Discussion started by: ajaykumarb
0 Replies

7. Shell Programming and Scripting

SFTP latest file from Windows server to Unix host

Hi All, I am SFTP ing file from Windows server (Sydney) to Unix host in London (both servers are on different timezones). It appears the upstream (Windows server team) does not do a file housekeeping activity and henceforth there are multiple files i.e. each week the script is scheduled to run... (1 Reply)
Discussion started by: vigdmab
1 Replies

8. Shell Programming and Scripting

sftp Connection from Unix to Windows 2003 server using Passphrase

Hi All, I am trying to connect from Unix machine to Windows 2003 server using passphrase method. It is connecting to the server and the connection is immediately closing. Below is the stack trace. Can anyone let me know what wrong with it? cwadmin@iut1wps1:/home/cwadmin> ssh username@targetip... (1 Reply)
Discussion started by: vijayin
1 Replies

9. Shell Programming and Scripting

SFTP failure from unix to windows server

Hi, I am having unix server SUNW,Sun-Fire-V245. remote windows server details: Microsoft Windows In my script i am sftp'ing files to the windows server through sftp command. But the problem i am facing is, some files are successfully sftp'd to windows server and for some files sftp is... (0 Replies)
Discussion started by: syamkp
0 Replies

10. Shell Programming and Scripting

SFTP from UNIX (AIX) to Windows 2000 server

Hi all, I have to sftp a file (put) from AIX server to Windows 2000 server. The question is Windows 200 server that i am using doesnt have any SFTP server , if so i know we need to install one. The question here is for writing a sftp script that as to run everyday as part of cron job we... (0 Replies)
Discussion started by: reddymails
0 Replies
Login or Register to Ask a Question