Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to sftp fron UNIX to window server using expect? Post 303020768 by Don Cragun on Friday 27th of July 2018 03:38:19 AM
Old 07-27-2018
I didn't say anything about changing:
Code:
spawn sftp root@xx.xx.xx.xx

in your script to:
Code:
sftp root@xx.xx.xx.xx

I suggested changing:
Code:
send "abcd1234\n"

in your script to:
Code:
send "abcd1234\r"

And noted that you could also change:
Code:
send "cd /tmp \r"
expect "sftp>"
send "mput t.txt \r"
expect "sftp>"
send "quit \r"

in your script to:
Code:
send "cd /tmp\r"
expect "sftp>"
send "mput t.txt\r"
expect "sftp>"
send "quit\r"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

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, #!/usr/local/bin/expect #!/bin/ksh ... (12 Replies)
Discussion started by: pranavagarwal
12 Replies

2. Shell Programming and Scripting

SFTP Shell Script from a Unix server to another

I am facing a typical issue for transfering files through secured FTP (SFTP) for example, i have three different servers a,b & c server A - where data file resides Server B - where Unix shell program resides here(source server) server C - Destination server I wanted to run the shell... (1 Reply)
Discussion started by: kumarm
1 Replies

3. UNIX for Dummies Questions & Answers

scp or sftp to Window server

Dear Unix Gurus, I have a question to confirm before I proceed to script my program. I'm currently running on IBM AIX Ver 5.3. I just like to know if it's compatible to use scp or sftp between AIX and Wintel server? I'm trying to scp or sftp a file from AIX to Window server and I was... (1 Reply)
Discussion started by: lweegp
1 Replies

4. AIX

Setup Window server to accept AIX SFTP client

To all the expert out there, I have successfully setup a AIX to AIX auto-SFTP with no password requested. Now my aim is to setup a AIX to Window auto-SFTP with no password requested as well. But I faced some problem that I do not know how to solve it. I have followed the setting of AIX's... (8 Replies)
Discussion started by: kwliew999
8 Replies

5. UNIX for Dummies Questions & Answers

SFTP files from Unix to Window Server

I have a requirement, where in we need to SFTP files from the Unix box to the Windows server. Since we are putting files...Where would we place the public/private keys from the Unix servers?? Any default path as such??? How would the sftp happen from Unix to Windows...Please help... ... (1 Reply)
Discussion started by: saggiboy10
1 Replies

6. 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

7. Programming

Calling UNIX command fron FORTRAN

I want to run the unix command in a fortran code echo trim(val_fgsize) | awk '{split($1, a, "/"); print a}'I am trying like this but getting problems s='echo ' // trim(val_fgsize) // '| awk '{split($1, a, "/"); print a}'' call system(s) ---------- Post updated at 05:15 PM ----------... (1 Reply)
Discussion started by: kristinu
1 Replies

8. Shell Programming and Scripting

File Transfer from Window server to UNIX and UNIX to UNIX

Dear All, Can someone help to command or program to transfer the file from windows to Unix server and from one unix server to another Unix server in secure way. I would request no samba client. (4 Replies)
Discussion started by: yadavricky
4 Replies

9. 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

10. UNIX for Beginners Questions & Answers

How to ftp or sftp from workplace to UNIX server?

Hi All, Seeking for your assistance on how to ftp or sftp from workplace to unix server? i tried ftp user/pass but it says "command not found" i tried sftp user@localhost i can't connect. Please advise, Thanks, (1 Reply)
Discussion started by: znesotomayor
1 Replies
sftp-server(1M) 					  System Administration Commands					   sftp-server(1M)

NAME
sftp-server - SFTP server subsystem SYNOPSIS
/usr/lib/ssh/sftp-server DESCRIPTION
sftp-server implements the server side of the SSH File Transfer Protocol as defined in the IETF draft-ietf-secsh-filexfer. sftp-server is a subsystem for sshd(1M) and must not be run directly. There are no options or config settings. To enable the sftp-server subsystem for sshd add the following to /etc/ssh/sshd_config: Subsystem sftp /usr/lib/ssh/sftp-server See sshd_config(4) for a description of the format and contents of that file. There is no relationship between the protocol used by sftp-server and the FTP protocol (RFC 959) provided by in.ftpd. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. FILES
/usr/lib/sftp-server ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWsshdu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
sftp(1), ssh(1), ssh-add(1), ssh-keygen(1), sshd(1M), sshd_config(4), attributes(5) To view license terms, attribution, and copyright for OpenSSH, the default path is /var/sadm/pkg/SUNWsshdr/install/copyright. If the Solaris operating environment has been installed anywhere other than the default, modify the given path to access the file at the installed location. AUTHOR
Markus Friedl SunOS 5.10 30 Jul 2003 sftp-server(1M)
All times are GMT -4. The time now is 04:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy