Problems when automating sftp

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problems when automating sftp
# 1  
Old 10-28-2009
Problems when automating sftp

Hi Guys,

I am working on a shell script, which gets log files from a windows machine.


1. My server doesn't support FTP, so i am using SFTP

2. I am not able to automate sftp using public key generation technique, because i need to access many windows machines using this script.

so please let me know if is there any way to automate sftp?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problems with expect and sftp in bash

I'm having trouble with some automated sftp pulls. I'm using expect inside bash scripts and spawning SFTP. Some times the expect seems bog down. I have tried to put sleeps in my code to give everything time to work before I move on to next step but I till continue to get issues. For example when... (2 Replies)
Discussion started by: gosteen
2 Replies

2. Shell Programming and Scripting

Sftp : not able to print the echo statements after the sftp transfer

I had the below sftp script working perfectly but the problem is I am not able to send the echo statements . #!/bin/sh echo "Starting to sftp..." sftp admin@myip << END_SCRIPT cd /remotepath/ lcd /localpath/ mget myfiles*.csv bye END_SCRIPT echo "Sftp successfully." echo echo... (11 Replies)
Discussion started by: scriptscript
11 Replies

3. Red Hat

Chroot sftp users, remote sftp login shows wrong timestamp on files

Hello, I have a weird issue, I have RHEL 5.7 running with openssh5.2 where sftpgroup OS group is chroot. I see the difference difference in timestamp on files, when I login via ssh and SFTP, I see four hour difference, is something missing in my configuration. #pwd... (8 Replies)
Discussion started by: bobby320
8 Replies

4. Shell Programming and Scripting

Issues with automating SFTP command

Hi All, I am currently looking at automating the steps that I follow to download log files from putty to desktop. I connect to a client's machine through citrix desktop. I am required to download quite a number of application logs to identfiy the issues in production. Steps that is being... (3 Replies)
Discussion started by: krackjack84
3 Replies

5. Shell Programming and Scripting

SFTP-how to log individual sftp command error while executing shell script

Hi, I have situation where i need to automate transferring 10000+ files using sftp. while read line do if ; then echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt fi done< files.txt sftp -b sftpCommand.txt stu@ The above... (1 Reply)
Discussion started by: noobrobot
1 Replies

6. UNIX for Dummies Questions & Answers

Problem automating sFTP transfer using script in cron

Hi Newbie here I am having problems with automating sFTP transfers. Just to save time - SCP is not an option as sFTP is stipulated by controllers of far end server. Ineed to automate sFTP transfer of a single file, once a day to a remote server to which i have no control over. I am using:... (6 Replies)
Discussion started by: robbien
6 Replies

7. Solaris

Issues with automating SFTP

Hi We are trying to set up a non-interactive sftp to one of our clients to be able to transfer files to them. For the setup I logged into server1 as user1 and generated RSA public and private keys id_rsa and Then I did an sftp to server2 as user2 and put the in the .ssh... (4 Replies)
Discussion started by: vnparo
4 Replies

8. AIX

Problems with SSH/SFTP between AIX and Mainframe

Hi, I'm not sure if this has been solved in this forum already but please do help me out if possible. Basically, I've already setup a passwordless SSH connection between 2 AIX IDs (say ID-1 and ID-2) with a Mainframe server ID (say MVSID). I'm able to successfully do an SSH from the AIX server to... (1 Reply)
Discussion started by: sambeet
1 Replies

9. Shell Programming and Scripting

Automating SFTP with Expect

Hello all, I've written an automated SFTP script to work with the Expect command. It recently occurred to me however, that if the client side box does not have the known host entry for the server, it will not work correctly. So I have added an expect for the known host prompt, and that part... (2 Replies)
Discussion started by: sysera
2 Replies

10. Shell Programming and Scripting

automating sftp script

I have to write an automated sftp script which uses password authentication method to access the remote server. I want to pass the password as a parameter or to be included in the script itself, so that when i run the sftp script, it should not prompt me to enter the password. Thanks in advance... (1 Reply)
Discussion started by: Rajeshsu
1 Replies
Login or Register to Ask a Question
SFTP-SERVER(8)						    BSD System Manager's Manual 					    SFTP-SERVER(8)

sftp-server -- SFTP server subsystem SYNOPSIS
sftp-server [-ehR] [-f log_facility] [-l log_level] [-u umask] DESCRIPTION
sftp-server is a program that speaks the server side of SFTP protocol to stdout and expects client requests from stdin. sftp-server is not intended to be called directly, but from sshd(8) using the Subsystem option. Command-line flags to sftp-server should be specified in the Subsystem declaration. See sshd_config(5) for more information. Valid options are: -e Causes sftp-server to print logging information to stderr instead of syslog for debugging. -f log_facility Specifies the facility code that is used when logging messages from sftp-server. The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. The default is AUTH. -h Displays sftp-server usage information. -l log_level Specifies which messages will be logged by sftp-server. The possible values are: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. INFO and VERBOSE log transactions that sftp-server performs on behalf of the client. DEBUG and DEBUG1 are equivalent. DEBUG2 and DEBUG3 each specify higher levels of debugging output. The default is ERROR. -R Places this instance of sftp-server into a read-only mode. Attempts to open files for writing, as well as other operations that change the state of the filesystem, will be denied. -u umask Sets an explicit umask(2) to be applied to newly-created files and directories, instead of the user's default mask. For logging to work, sftp-server must be able to access /dev/log. Use of sftp-server in a chroot configuration therefore requires that syslogd(8) establish a logging socket inside the chroot directory. SEE ALSO
sftp(1), ssh(1), sshd_config(5), sshd(8) T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, draft-ietf-secsh-filexfer-00.txt, January 2001, work in progress material. HISTORY
sftp-server first appeared in OpenBSD 2.8. AUTHORS
Markus Friedl <> BSD
January 9, 2010 BSD