sftp shell script - Password read error.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sftp shell script - Password read error.
# 1  
Old 10-25-2010
sftp shell script - Password read error.

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 Profile couldn't be read: faulty permissions.


the sftp command in script -->

Failed one-->
Code:
sftp --password=file://CNRHIDProfile -b 1000000000 -B CNRHIDBatch -v ftp@tst4517 1>>sftp1.log 2>>sftp2.log

Working one -->
Code:
sftp --password=file://CNRHIDProfile -b 1000000000 -B CNRHIDPatcher -v ftp@tst4517 1>>sftp1.log 2>>sftp2.log

Note: Both the commands read the same password file.

Regards,
Vinodh Kumar
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SFTP script still asking password

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

2. Shell Programming and Scripting

SFTP or scp with password in a batch script without using SSH keys and expect script

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

3. Shell Programming and Scripting

How to run sftp in shell script without prompting for password?

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

4. Shell Programming and Scripting

SFTP prompting for password even though password is in script

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

5. 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

6. Shell Programming and Scripting

Shell Script to Automatically Read My Password

I have a shell script to run set of commands every week . I dont have a root access on the server but I can run the commands using pbrun cat myscript.sh * * * pbrun command.... each time I run the script , it asks me for my password then it executes fine. ./myscript.sh Password... (7 Replies)
Discussion started by: Sara_84
7 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. UNIX for Advanced & Expert Users

SFTP password expire error

Hi, I am using sftp in batch script for which all configuration for public/private keys are done and it works fine without asking a password. No issues till this point. Now I the problem I have is that if the password expires/someone changes the authentication keys at reote server then the... (4 Replies)
Discussion started by: coolwade
4 Replies

9. Shell Programming and Scripting

SFTP in Shell Script with RSA-KEY or password.

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

10. Shell Programming and Scripting

how to give sftp a password in a shell scripit

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
Login or Register to Ask a Question
SSH2_SFTP_LSTAT(3)							 1							SSH2_SFTP_LSTAT(3)

ssh2_sftp_lstat - Stat a symbolic link

SYNOPSIS
array ssh2_sftp_lstat (resource $sftp, string $path) DESCRIPTION
Stats a symbolic link on the remote filesystem without following the link. This function is similar to using the lstat(3) function with the ssh2.sftp:// wrapper in PHP 5 and returns the same values. PARAMETERS
o $sftp - o $path - Path to the remote symbolic link. RETURN VALUES
See the documentation for stat(3) for details on the values which may be returned. EXAMPLES
Example #1 Stating a symbolic link via SFTP <?php $connection = ssh2_connect('shell.example.com', 22); ssh2_auth_password($connection, 'username', 'password'); $sftp = ssh2_sftp($connection); $statinfo = ssh2_sftp_lstat($sftp, '/path/to/symlink'); $filesize = $statinfo['size']; $group = $statinfo['gid']; $owner = $statinfo['uid']; $atime = $statinfo['atime']; $mtime = $statinfo['mtime']; $mode = $statinfo['mode']; ?> SEE ALSO
ssh2_sftp_stat(3), lstat(3), stat(3). PHP Documentation Group SSH2_SFTP_LSTAT(3)