Sponsored Content
Full Discussion: SFTP Shell script
Top Forums Shell Programming and Scripting SFTP Shell script Post 302611069 by Arpit Narula on Friday 23rd of March 2012 05:59:20 AM
Old 03-23-2012
Thanks a Lot Jim. That works.

I have another question:
On Server A, I generated the Public Private keys.
and shared the Public Key in /authorised_keys file on Server B.

Now can I do the passwordless communication from Server B(having public key only) to Server A(having Public as well as Private key)
as well....Or it is only possible from Server A to Server B

---------- Post updated 03-23-12 at 04:59 AM ---------- Previous update was 03-22-12 at 06:07 AM ----------

Please anyone.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

f-secure sftp in shell script

Hi, I am trying to use sftp in a ksh - Shell script, but not even a simple script like this returns not output: sftp username@remotehost <<END ls END If I do something like this: sftp username@remotehost <<END | tee logfile ls END I get this error message: Warning: tcgetattr... (1 Reply)
Discussion started by: friand
1 Replies

2. Shell Programming and Scripting

SFTP shell script help

HI I need to write script to transefer files from windows server to UNIX and visa versa.... can any one enroute to the solution ........? I am new to SFTP .. would requst you provide some helpful informaion, Basics of SFTP also appreciated Thanks in Advance. Madan (1 Reply)
Discussion started by: madankumar
1 Replies

3. Shell Programming and Scripting

Reg sftp in shell script

Hi, I want to retrieve files from an sftp site and place it a directory in unix server. When I try to connect, it is asking password even if i hardcode it in the script.I want to automate the script. Could anyone tell me how to avoid password prompt. #!/bin/sh # sample automatic ftp script... (3 Replies)
Discussion started by: vidhya_vec
3 Replies

4. Shell Programming and Scripting

SFTP connection using shell script

Hi , I am able to manually connect to remote system usning "sftp" protocol. But when I using the below command in the script but I am not able to connect. `sftp TEST01@120.34.3.4` And the connection should not be closed after login. Please help to solve this. Thanks Satya (2 Replies)
Discussion started by: Satyak
2 Replies

5. Shell Programming and Scripting

shell script to get sftp files

did anyone knows a script to get a latest file in a folder,,i try to get the newest file at a folder via sftp and i want to make a crontab to do this once a day,,can someone give me the script to get the latest file?? (5 Replies)
Discussion started by: Cellscript
5 Replies

6. Shell Programming and Scripting

SFTP to server through Shell Script

I am sftp-ing to a server through a shell script from my local machine. sftp user@host put out.txt bye On executing the script, it prompts to enter the password, and after giving the password it successfully connects to the host.But the problem is that the remaining statements after the... (1 Reply)
Discussion started by: Kishore_1
1 Replies

7. 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@192.168.2.1 The above... (1 Reply)
Discussion started by: noobrobot
1 Replies

8. Shell Programming and Scripting

Execute shell script within sftp session

Hi all , can any one tell me how to run a script within a sftp session. let me tell u in bit clear way : After I connected to sftp location , cd ing to some directory then I need to execute a one script. Please tell me if u have any idea on this . Looking forward to your reply guys... (1 Reply)
Discussion started by: sravan008
1 Replies

9. Shell Programming and Scripting

Help With SFTP using shell script

Hi All, Scenario : How to securely FTP the text file from a particular location(in unix system) to the windows ftp server (my PL is suggesting to use SCP command to accomplish this). Detailed description: I have created a Oracle job and scheduled it in dbms_scheduler. The job will invoke... (3 Replies)
Discussion started by: Sachi Vasishta
3 Replies

10. Shell Programming and Scripting

SFTP password through shell script.

Hi All, I would be happy, if someone help me on this that I have only SFTP ID and Password to transfer some log files from webserver boxes to SFTP server Anyone help me that how to pass the password parameter throough the shell scripts, since i don't have ssh login access on the SFTP... (2 Replies)
Discussion started by: l_gshankar24
2 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 09:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy