Operating System - HP-UX
1819681 Members
3539 Online
109605 Solutions
New Discussion

provide password during scp command.

 
Alok_Behria
Advisor

provide password during scp command.

Hi All,

 

I am sitting on HP UX 11.11 and I need to perform the scp to different host. in porder to achieve this, I have created ths sh file , but it's getting for password problem.

 

 

nohup sh scp.sh

 

below commands inside the scp.sh file

 

scp -p file_name target@osuser:/db/qa05/export/

 

5 REPLIES 5
Dennis Handly
Acclaimed Contributor

Re: provide password during scp command.

Have you set up the keys for ssh?  And do the files and directories have the right permissions?

Alok_Behria
Advisor

Re: provide password during scp command.

 

 

we have everything set up , it's only , when i run the sh file in background, it got failed becuase of the passowrd for oraqa05 on oradev3 host. now, i need something like, where i can script the password , so that i can run this in background , without any intraction. i hope, i am clear.

 

prod02> nohup sh scp.sh &

[5] + Stopped (tty output)     nohup sh scp.sh &

scp -p edemo_eshare_28feb.dump.gz edemo_eshare_28feb.log oraqa05@oradev3:/db/qa05/export/
oraqa05@oradev3's password:
edemo_eshare_28feb.d 24% |***********

 

Steven Schweda
Honored Contributor

Re: provide password during scp command.

 
Dennis Handly
Acclaimed Contributor

Re: provide password during scp command.

>we have everything set up

 

What do you have set up?

You can use ssh and:

1) Still have passwords

2) Have a passphrase instead

3) Have password/passphraseless logins.

4) Host-based with ~/.rhosts or ~/.shosts

 

For 2) you can also cache the passphrase in a ssh-agent, added with ssh-add.

 

Which do you want to do?

BalachandraST
Occasional Visitor

Re: provide password during scp command.

This problem could be overcome by configuring authentication with public keys instead of using passwords.

Follow the steps in "HP-UX Secure Shell Getting Started Guide" to configure public key authentication. The guide is available at the following link:

http://bizsupport2.austin.hp.com/bc/docs/support/SupportManual/c03243765/c03243765.pdf