Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Linux for beginners-SFTP a file Post 303001204 by jim mcnamara on Saturday 29th of July 2017 08:52:04 PM
Old 07-29-2017
You have to set up ssh keys on both the local and the remote boxes FIRST.
Then you can use passwordless file transmission.

Debian example, works almost anywhere:
How to set up ssh so you aren't asked for a password
This User Gave Thanks to jim mcnamara For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SFTP vs FTP and going UNIX to LINUX

I have automated an ftp process that FTP's files from one UNIX box to another in the following format: ftp -n -v $REMOTE_SERV << EOF user $FTP_USER $FTP_PASS cd $REMOTE_PATH put $CUR_NAME $NEW_NAME bye But how can I accomplish this SFTPing from a UNIX box to a LINUX box? I've seen... (4 Replies)
Discussion started by: TimBurke
4 Replies

2. Windows & DOS: Issues & Discussions

How to connect SFTP(Linux) from Windows DOS

I need to write a batch script for file transfer from SFTP to Windows system. SFTP is on Linux system. I kept this code in batch file and executing it.. but not working.. Even i tried from Command prompt like this "open sftp.host.com" but getting error. Can anyone help with the code and tell me how... (15 Replies)
Discussion started by: mohantmk
15 Replies

3. Emergency UNIX and Linux Support

solaris or linux sftp/ftp-server

Hi, we have a big problem, history: we migrated our companies ftp and sftp-server, which were vsftp and openssh, to one server, software is called JSCAPE ftp server professional edition for the first time everything was great, but after one or two months, our uploads hang, 0 byte files are... (11 Replies)
Discussion started by: funksen
11 Replies

4. Shell Programming and Scripting

File locking (Unix/Linux) & sftp

Hi all, Can anyone help ...on how to ensure that a file is locked . thanks & regards, Soodoo ---------------------------------------- Problem description: - We usually use the mv command in scripts to make sure that a file is complete and not being written to by another process. ... (1 Reply)
Discussion started by: soodoo
1 Replies

5. UNIX for Advanced & Expert Users

Sftp working on Linux but error on HP UX

Hi the below two line in my sh work fine in Linux but when I run it in HP UX it throws error saying "No such file or directory (-)." can anyone pleas let me know what is wrong. Any help is appreciated. INPUTFILE="$(echo ls -1t | sftp -b- $SFTPSERVER:$SFTPDIR |grep ^LK| head -1)" echo... (1 Reply)
Discussion started by: murtymvvs
1 Replies

6. Linux

SFTP files to a server from Linux.

Hi, I am looking for a shell script to sftp to a file server and copy all the files from a directory after the script is run. The server name should be a user input parameter and of-course the username/password as well. Rest all should be handled by the script. I tried with below snippet:- ... (1 Reply)
Discussion started by: happysingh
1 Replies

7. Red Hat

SFTP to VM Linux

Hi . We have customer users uploading sales data in excel format in a portal, once this file is uploaded a batch process will SFTP the file from here to a linux virtual machine and then to the mainframe . We are seeing that there are many cases where all the rows the user entered in excel file... (1 Reply)
Discussion started by: ron5174
1 Replies

8. UNIX for Beginners Questions & Answers

Sftp connection not establishing from Linux to DataPower

Hi Everyone, I am trying to send files from Linux to DataPower server using public key based authentication but it's not working as expected and every-time password expecting for sftp transfer. Can someone please help on this? Steps I fallowed: Created keys pair at source server... (4 Replies)
Discussion started by: renukeswar
4 Replies

9. UNIX for Beginners Questions & Answers

Which Linux Certification comes first for beginners?

I want to get a Linux Certification to start my Career in IT sector. My Qualification is MCS from a top university. Suggest me some Linux Certifications. (1 Reply)
Discussion started by: alexwatson1711
1 Replies
libssh2_sftp_write(3)						  libssh2 manual					     libssh2_sftp_write(3)

NAME
libssh2_sftp_write - write SFTP data SYNOPSIS
#include <libssh2.h> #include <libssh2_sftp.h> ssize_t libssh2_sftp_write(LIBSSH2_SFTP_HANDLE *handle, const char *buffer, size_t count); DESCRIPTION
libssh2_sftp_write(3) writes a block of data to the SFTP server. This method is modeled after the POSIX write() function and uses the same calling semantics. handle - SFTP file handle as returned by libssh2_sftp_open_ex(3). buffer - points to the data to send off. count - Number of bytes from 'buffer' to write. Note that it may not be possible to write all bytes as requested. libssh2_sftp_handle(3) will use as much as possible of the buffer and put it into a single SFTP protocol packet. This means that to get maximum performance when sending larger files, you should try to always pass in at least 32K of data to this function. WRITE AHEAD
Starting in libssh2 version 1.2.8, the default behavior of libssh2 is to create several smaller outgoing packets for all data you pass to this function and it will return a positive number as soon as the first packet is acknowledged from the server. This has the effect that sometimes more data has been sent off but isn't acked yet when this function returns, and when this function is subsequently called again to write more data, libssh2 will immediately figure out that the data is already received remotely. In most normal situation this should not cause any problems, but it should be noted that if you've once called libssh2_sftp_write() with data and it returns short, you MUST still assume that the rest of the data might've been cached so you need to make sure you don't alter that data and think that the version you have in your next function invoke will be detected or used. The reason for this funny behavior is that SFTP can only send 32K data in each packet and it gets all packets acked individually. This means we cannot use a simple serial approach if we want to reach high performance even on high latency connections. And we want that. RETURN VALUE
Actual number of bytes written or negative on failure. If used in non-blocking mode, it returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is a negative num- ber, it isn't really a failure per se. If this function returns 0 (zero) it should not be considered an error, but simply that there was no error but yet no payload data got sent to the other end. ERRORS
LIBSSH2_ERROR_ALLOC - An internal memory allocation call failed. LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket. LIBSSH2_ERROR_SOCKET_TIMEOUT - LIBSSH2_ERROR_SFTP_PROTOCOL - An invalid SFTP protocol response was received on the socket, or an SFTP operation caused an errorcode to be returned by the server. SEE ALSO
libssh2_sftp_open_ex(3) libssh2 0.15 1 Jun 2007 libssh2_sftp_write(3)
All times are GMT -4. The time now is 02:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy