05-27-2013
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 Server.. only option to pass the password through my script.
Looking some quick response.Thanks in advance
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
I'm writing a script which actually sftp's(gets!! i'm using mget) files from a windows box to unix server. (i've gone thru forum and got pretty good answers, Thx for that).
but the windows box to which i'm ftp'g prompts for a password change every 30 days. so please suggest me how to do... (3 Replies)
Discussion started by: rosh0623
3 Replies
2. Shell Programming and Scripting
I want to write an sftp script, but I can't put ssh keys on my destination. Is it possible to pass sftp a password inside a script? I know that the -b option makes sftp use a file for params. Can the password go in such a file? How can I do this? Thanks in advance (3 Replies)
Discussion started by: kskywr
3 Replies
3. Shell Programming and Scripting
I am trying to SFTP to a couple sites. One has an RSA-KEY that was sent to me. Currently I am running that manually using WinSCP. I would like to set it up as a CRON process on our Linux host (Sun).
Can I use the rsa-key they sent me in any directory or does it need to be placed in a specific... (2 Replies)
Discussion started by: alemat
2 Replies
4. Shell Programming and Scripting
Hi,
I have script which does the sftp function. In the script in one place it able to read the password from file and other place files with below error.
warning: has much more security than supplying the password in the clear
warning: on the command line.
Failed to get password: File... (0 Replies)
Discussion started by: vino_hymi
0 Replies
5. Shell Programming and Scripting
I am working on a sftp batch script on a Solaris machine and I need to connect using password. This is not an issue when i do it manually but when I want to make this into a script, i find there are no options for password.
Can anyone suggest how I can do it with password? I know using keys is... (3 Replies)
Discussion started by: Leion
3 Replies
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
Hi All,
I am trying to transfer a file from one server to a remote server using SFTP. Client is not ready for key setup.
I am working on Solaris 10.
Here is the code.
#!/bin/ksh
# sample automatic Sftp script to dump a file
USER="user1"
PASSWORD="pass1"
HOST="host1"
sftp $USER@$HOST... (6 Replies)
Discussion started by: megha2525
6 Replies
8. Shell Programming and Scripting
Hi,
Can anyone tell me how to pass password in a shell script for sftp so that i can run it in background without user entering the password?
I used a expect script but it timesout after some time and the process remains incomplete at the end.
Can anyone suggest any other idea?
Will the... (3 Replies)
Discussion started by: Little
3 Replies
9. Shell Programming and Scripting
Dear All,
I have a requirement where I have to SFTP or SCP a file in a batch script. Unfortunately, the destination server setup is such that it doesn't allow for shell command line login. So, I am not able to set up SSH keys. My source server is having issues with Expect. So, unable to use... (5 Replies)
Discussion started by: ss112233
5 Replies
10. Shell Programming and Scripting
Hi All,
I have FTP script snippet
targetFTP=testcomp
userID=testid
userPass=XXXXX
server_availability ()
{
echo "***********************************************************" >> $FtpLog
echo "* Server Availability & User Access Checks *" >> $FtpLog
echo... (2 Replies)
Discussion started by: Riverstone
2 Replies
LEARN ABOUT DEBIAN
net::sftp::foreign::constants
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)