Sponsored Content
Top Forums Shell Programming and Scripting passwordless authentication of SFTP script Post 302368245 by sidd85 on Wednesday 4th of November 2009 11:39:21 AM
Old 11-04-2009
Hi All,

I need a solution for my issue below.

I have a source and destination, between which i need to connect through SFTP, go to a folder and list files(*.xls) and output that to a file in the destination server location.
We have done this using FTP, but i have to do this through SFTP, I have enabled and put public/private keys in place in both source and destination server.

Please refer to the script that was used with FTP, have to replicate this for SFTP....

ftp -i server_name <<REMOTE_EX
cd folder
ls *.xls temp_ls.dat
bye
REMOTE_EX
 

10 More Discussions You Might Find Interesting

1. AIX

Passwordless authentication via SSH

I am trying to implement passwordless authentication via ssh2. I have used the well documented technique of generating a key pair with a blank passphrase on my client machine, and installing the public key on the destination server (AIX 5.3) in the user's .ssh2 directory. I have used this technique... (1 Reply)
Discussion started by: RegX
1 Replies

2. AIX

Passwordless root authentication via SSH

Hello, I would like to issue a couple of commands as root on a remote machine without having to enter the root password. I used "ssh-keygen -t rsa" to generate the encryption keys, copied the public key to the remote machine, etc. I also tried playing around with the sshd_config file and... (3 Replies)
Discussion started by: sphericon
3 Replies

3. HP-UX

sftp/scp/ssh script with password as authentication

Hello, Do you guys know set of commands that can incorporate to sftp/scp/ssh to add password in a script to automate file transfer. Our client is not using ssh keys authentication so we are force to create a script to pass the password into the script to transfer files via sftp/scp/ssh. We... (4 Replies)
Discussion started by: james_falco
4 Replies

4. Shell Programming and Scripting

Setup multiple passwordless authentication

I have experience in setting up passwordless authentication by sharing ssh public keys manually.Currently I am in the process to the write a script to perform the same functionality from one source(host) to multiple destinations. I have one source host (Host A) whose public keys has to be shared... (9 Replies)
Discussion started by: Lancel0t
9 Replies

5. Red Hat

ssh private key passwordless authentication

Hello, Need a suggestion to setup private key passwordless authentication. I am not sure this can done or not :wall: here is the sincerio I have two servers, sever1 with a user "user1" and servera with usera here dataflow: usera from servera, will pull/push files to server1 on user1... (2 Replies)
Discussion started by: bobby320
2 Replies

6. Ubuntu

Passwordless ssh authentication fails

Unable to set ssh passwordless authentication I am unable to ssh with passwordless authentication from Windows client onto UBuntu server. The ssh version on UBuntu is OpenSSH_5.8p1 Debian-7ubuntu1, OpenSSL 1.0.0e , while SSH on Windows Client is OpenSSH_5.1p1, OpenSSL 0.9.8k. I turned on ssh... (5 Replies)
Discussion started by: tkota
5 Replies

7. Shell Programming and Scripting

Passwordless Authentication and Anonymous login

Hi, I am in the process FTPing some of my report files from my production server to another FTP server through batch/Shell Script. This is working fine with the password less authentication. Once i place all my report files in the ftp server the end users need to download ... (3 Replies)
Discussion started by: Showdown
3 Replies

8. UNIX for Dummies Questions & Answers

Pearl script Net::SFTP authentication error

#!/usr/local/bin/perl -w use Net::SFTP; use File::Copy; my $user=(getpwuid($<)); my $server = "servername"; print "user - $user server - $server \n"; my %args = ( user => "$user", ssh_args => {port=> 'portnum'} ); $args{debug} = 1; $args{user} = "user"; my $sftp=Net::SFTP->new($server,... (1 Reply)
Discussion started by: Yashaswini H L
1 Replies

9. Shell Programming and Scripting

Ssh passwordless authentication

Hey team I have to enable password less authentication betweeen A to B server and A to C server and A to D server. For this I generated a ssh key on server A using ssh-keygen command and copied the key using ssh-copy-id command to B, C and D server. Everything is working fine as of now but... (5 Replies)
Discussion started by: Sandeep_sandy
5 Replies

10. UNIX for Beginners Questions & Answers

How to use passwordless sftp in script?

Hi I am trying to do SFTP in shell script in such a way that it should not ask for password. for this is use below script but it prompt for password. here I am not abled to understand where I am making mistake. #!/bin/bash # SFTP TO remote server USER="ITO" PASSWORD="abcd@1234"... (4 Replies)
Discussion started by: scriptor
4 Replies
Net::SFTP::Foreign::Constants(3pm)			User Contributed Perl Documentation			Net::SFTP::Foreign::Constants(3pm)

NAME
Net::SFTP::Foreign::Constants - Constant definitions for Net::SFTP::Foreign SYNOPSIS
use Net::SFTP::Foreign::Constants qw(:tag SSH2_FILEXFER_VERSION); print "Protocol version is ", SSH2_FILEXFER_VERSION; DESCRIPTION
Net::SFTP::Foreign::Constants provides a list of exportable SFTP constants: for SFTP messages and commands, for file-open flags, for status messages, etc. Constants can be exported individually, or in sets identified by tag names. Net::SFTP::Foreign::Constants provides values for all of the constants listed in the SFTP protocol version 3 draft; the only thing to note is that the constants are listed with the prefix "SSH2_" instead of "SSH_". So, for example, to import the constant for the file-open command, you would write: use Net::SFTP::Foreign::Constants qw( SSH2_FXP_OPEN ); TAGS
As mentioned above, constants can either be imported individually or in sets grouped by tag names. The tag names are: :fxp Imports all of the "SSH2_FXP_*" constants: these are the constants used in the messaging protocol. :flags Imports all of the "SSH2_FXF_*" constants: these are constants used as flags sent to the server when opening files. :att Imports all of the "SSH2_FILEXFER_ATTR_*" constants: these are the constants used to construct the flag in the serialized attributes. The flag describes what types of file attributes are listed in the buffer. :status Imports all of the "SSH2_FX_*" constants: these are constants returned from a server "SSH2_FXP_STATUS" message and indicate the status of a particular operation. :error Imports all the "SFTP_ERR_*" constants used to represent high level errors: "SFTP_ERR_LOCAL_ALREADY_EXISTS", "SFTP_ERR_LOCAL_CHMOD_FAILED", "SFTP_ERR_LOCAL_OPEN_FAILED", "SFTP_ERR_LOCAL_READ_ERROR", "SFTP_ERR_LOCAL_STAT_FAILED", "SFTP_ERR_LOCAL_UTIME_FAILED", "SFTP_ERR_LOCAL_WRITE_FAILED", "SFTP_ERR_REMOTE_BAD_PACKET_SEQUENCE", "SFTP_ERR_REMOTE_BAD_PERMISSIONS", "SFTP_ERR_REMOTE_BAD_TIME", "SFTP_ERR_REMOTE_BLOCK_TOO_SMALL", "SFTP_ERR_REMOTE_CLOSE_FAILED", "SFTP_ERR_REMOTE_FSETSTAT_FAILED", "SFTP_ERR_REMOTE_FSTAT_FAILED", "SFTP_ERR_REMOTE_LSTAT_FAILED", "SFTP_ERR_REMOTE_MKDIR_FAILED", "SFTP_ERR_REMOTE_OPENDIR_FAILED", "SFTP_ERR_REMOTE_OPEN_FAILED", "SFTP_ERR_REMOTE_READDIR_FAILED", "SFTP_ERR_REMOTE_READ_FAILED", "SFTP_ERR_REMOTE_REALPATH_FAILED", "SFTP_ERR_REMOTE_REMOVE_FAILED", "SFTP_ERR_REMOTE_RENAME_FAILED", "SFTP_ERR_REMOTE_RMDIR_FAILED", "SFTP_ERR_REMOTE_READLINK_FAILED", "SFTP_ERR_REMOTE_SYMLINK_FAILED", "SFTP_ERR_REMOTE_SETSTAT_FAILED", "SFTP_ERR_REMOTE_STAT_FAILED", "SFTP_ERR_REMOTE_WRITE_FAILED" and "SFTP_ERR_REMOTE_HARDLINK_FAILED". Note: these constants are not defined on the SFTP draft. :ext Import all the "SSH2_FXE_*" constants: there are the constants defined for usage with SFTP extensions. Currently, these are supported: "SSH2_FXE_STATVFS_ST_RDONLY", "SSH_FXE_STATVFS_ST_NOSUID". There is one constant that does not fit into any of the tag sets: "SSH2_FILEXFER_VERSION", which holds the value of the SFTP protocol implemented by Net::SFTP::Foreign. AUTHOR &; COPYRIGHTS Please see the Net::SFTP::Foreign manpage for author, copyright, and license information. perl v5.14.2 2012-05-11 Net::SFTP::Foreign::Constants(3pm)
All times are GMT -4. The time now is 02:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy