sftp/scp/ssh script with password as authentication


 
Thread Tools Search this Thread
Operating Systems HP-UX sftp/scp/ssh script with password as authentication
# 1  
Old 06-27-2008
Error 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 are looking other ways to code the script without first using HP Expect tool and perl scripting which also requires installation of certain libraries.

Can somebody help me how to tweak sftp/scp/ssh commands to received password via script so we can automate this one? Thanks a lot.
# 2  
Old 06-27-2008
You can do a hostbased authentication.
# 3  
Old 06-27-2008
This also means changing something on the target server. Our client don't want to change anything on there side right now. They are insisting the change must be on our side alone. They supply only the username/password and we'll connect via secure file transfer.

I'm looking on script changes. Is there a way to incorporate password authentication on a script?
# 4  
Old 05-27-2009
password authenication

James,
I haven't found any way within the SFTP process to call something to handle the password response. What I've done is to create an 'expect' script which accepts userid, control word, ip address, destination folder, and a filename to be transfered. The 'expect' software is required on the client side not the server side so you wouldn't have to modify the client's system. From their point of view, you are doing password responding. The 'expect' script is fairly simply as it sets the variables inside the 'expect' script, spawns an sftp process and then waits for replies and does sends when it gets the expected reply.

I would like to find a way also to do replying without 'expect' but a the moment, I don't know of a way.
# 5  
Old 05-27-2009
Just thoughts...
Woulndt a .netrc file do the job?

-----Post Update-----

man netrc(4)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

How to run commands on remote server using ssh password less authentication?

Hi, I need to run a script located in a directory on remote server by using ssh authentication from my local unix server. Can anyone help me in this. I have tried the below command. It worked for echo command but when i tried to open a file using cat command it is showing "cat: cannot open... (6 Replies)
Discussion started by: ssk250
6 Replies

3. Shell Programming and Scripting

How to pass password and prompt user for IP address while doing ssh and scp?

Hi All, I want to copy /.ssh/OM.pub file from source to destination. Here source IP address, username and password is always fixed. Whereas destination server IP address, password always gets changed. From destination server :- I am trying to write a script in which it should log in to... (3 Replies)
Discussion started by: madhur.baharani
3 Replies

4. Red Hat

prompting for passwords even i configured ssh password less authentication

There are two servers : 1. Site 2. Testing from site server i want to connect testing server with ssh password less authentication. i generated public and private keys with ssh-keygen -t rsa on site server. cat id_rsa >> authorized_keys cat id_rsa.pub >> authorized_keys i... (15 Replies)
Discussion started by: rehantayyab82
15 Replies

5. Shell Programming and Scripting

SFTP / SCP using password

Hi, I was provided with sftp servername, user and password and the requirement is to connect to sftp server using credentials provided and drop the file. Manually i am able to connect with commands like sftp user@servername and after clicking enter, i was asked for a password and entering... (4 Replies)
Discussion started by: forums123456
4 Replies

6. UNIX for Dummies Questions & Answers

SSH Keys Authentication keeps asking for password

Hi! Im trying to set access from ServerA(SunOS) to ServerB(Some custom Linux with Keyboard Interactive login) with SSH Keys. As a proof of concept I was able to do it between 2 virtual machines. Now in my real life scenario it isnt working. I created the keys in ServerA, copied them to... (7 Replies)
Discussion started by: RedSpyder
7 Replies

7. AIX

Able to scp/ssh to AIX 6.1 machine, unable to sftp to it

Hello, I am trying to figure out why I cannot sftp onto our aix6.1 machine. I can ssh/scp onto it, and sftp outbound seems to work properly, but I can't sftp onto it. # sftp aix61 Connecting to aix61... root@aix61's password: Connection closed # This machine appears to have the pware... (2 Replies)
Discussion started by: bstring
2 Replies

8. Solaris

bypass password authentication for sftp in unix

I am using solaris unix 8.2 version. I want to bypass password authentication for sftp. Can you please give some ideas on this. thanks.Regards. (4 Replies)
Discussion started by: vijill
4 Replies

9. Shell Programming and Scripting

Password less connection(sftp/ssh)

Dear All, I'm trying to configure a passwordless connection between two servers of HP-UX. i have srearched the configuration in google so many times and as per the guidence i have done all the steps, but still its not working and every time it is asking for password while trying to scp some file... (2 Replies)
Discussion started by: panknil
2 Replies

10. Red Hat

sftp/scp without password

Hi, I want to use sftp/scp without password.How can I do that ?? I plan to use script with scp/sftp and execute by cronjob ,any sample or example?? How can I test the scp/sftp working or not in the same user account , in the same red linux server?? any suggestion ??? (5 Replies)
Discussion started by: chuikingman
5 Replies
Login or Register to Ask a Question