Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Easy question - How do I combine scp & ssh?
#1

Hi. I'm a newbie and working on a shell script.

 

Trying to first get one small file from a web server -- wget [/url][url=http://test.com/myfile.xml]http://test.com/myfile.xml

 

Then I need to scp it to the db server. I've set up a single-purpose ssh keys and by running this can connect w/out entering password:

 

ssh -i ~/.ssh/whoisit MyHostName

 

 

My problems is this: when I run scp myfile.xml MyHostName:/dir1/dir2/myfile.xml, I get prompted for password.

If I run the ssh command above, I instantly connect to the db server and cannot scp, because I'm already on the remote machine.

 

So, my question is how do I utilize the ssh keys I've set up with scp. I just want to:

1) wget file

2) activate the ssh key, so I connect to the db server w/out entering password

3) copy the file to db servers /dir1/dir2

4) do some kind of a check if the file made it there allright

 

Thank you,

Reply


Messages In This Thread
Easy question - How do I combine scp & ssh? - by linoox - 2007-09-11, 02:51 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)