Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: User

SCP bash script

 

 

Gentoo user RSS feed   Index | Next | Previous | View Threaded


kit393 at gmail

May 3, 2012, 4:44 AM

Post #1 of 4 (209 views)
Permalink
SCP bash script

Hi guys,

I have a problem with scp bash script. I was trying to automate scp command
to copy files in and out, and I was trying to avoid key in the password
myself.

So I attempt to use the "here string" feature of bash, it didn't work with
scp.

And those server I am working with, they don't have expect package
installed. :-(

ps. I am not supposed to change the configuration of the servers( includes
setup openssh keys, or install expect)

You guys have any idea that can help this case?

Thanks & Regards,
kit393


adamcarter3 at gmail

May 3, 2012, 6:20 AM

Post #2 of 4 (177 views)
Permalink
Re: SCP bash script [In reply to]

On Thu, May 3, 2012 at 9:44 PM, LiangYun Gong <kit393 [at] gmail> wrote:
> Hi guys,
>
> I have a problem with scp bash script. I was trying to automate scp command
> to copy files in and out, and I was trying to avoid key in the password
> myself.
>
> So I attempt to use the "here string" feature of bash, it didn't work with
> scp.
>
> And those server I am working with, they don't have expect package
> installed. :-(
>
> ps. I am not supposed to change the configuration of the servers( includes
> setup openssh keys, or install expect)

Typically you would copy local:~/.ssh/id_dsa.pub (or non dsa
equivalent) into remote:~/.ssh/authorized_keys - since that's only
user level, no need for root access. Its changing the configuration of
the user on the remote machine, but since that user is you, its
usually ok.

You then use -i with scp.


kit393 at gmail

May 3, 2012, 8:52 AM

Post #3 of 4 (179 views)
Permalink
Re: SCP bash script [In reply to]

Right, I am just not sure that's the only way. Since I just want to copy
one file in and one file out on many servers, this solution will double the
work. It's just for servers auditing, you know.

But thanks a lot anyway. Appreciate you help. :-)

On Thu, May 3, 2012 at 9:20 PM, Adam Carter <adamcarter3 [at] gmail> wrote:

> On Thu, May 3, 2012 at 9:44 PM, LiangYun Gong <kit393 [at] gmail> wrote:
> > Hi guys,
> >
> > I have a problem with scp bash script. I was trying to automate scp
> command
> > to copy files in and out, and I was trying to avoid key in the password
> > myself.
> >
> > So I attempt to use the "here string" feature of bash, it didn't work
> with
> > scp.
> >
> > And those server I am working with, they don't have expect package
> > installed. :-(
> >
> > ps. I am not supposed to change the configuration of the servers(
> includes
> > setup openssh keys, or install expect)
>
> Typically you would copy local:~/.ssh/id_dsa.pub (or non dsa
> equivalent) into remote:~/.ssh/authorized_keys - since that's only
> user level, no need for root access. Its changing the configuration of
> the user on the remote machine, but since that user is you, its
> usually ok.
>
> You then use -i with scp.
>
>


poisonbl at gmail

May 3, 2012, 5:28 PM

Post #4 of 4 (174 views)
Permalink
Re: SCP bash script [In reply to]

On Thu, May 3, 2012 at 7:44 AM, LiangYun Gong <kit393 [at] gmail> wrote:
> Hi guys,
>
> I have a problem with scp bash script. I was trying to automate scp command
> to copy files in and out, and I was trying to avoid key in the password
> myself.
>
> So I attempt to use the "here string" feature of bash, it didn't work with
> scp.
>
> And those server I am working with, they don't have expect package
> installed. :-(
>
> ps. I am not supposed to change the configuration of the servers( includes
> setup openssh keys, or install expect)
>
> You guys have any idea that can help this case?
>
> Thanks & Regards,
> kit393

Well, expect is generally used client-side and doesn't require a
server-side counterpart, assuming you're pulling files to, or pushing
from, a machine you do have actual control of. SSH keys are the usual
means, since they don't involve writing a password somewhere in plain
text, but lacking those, expect on your own machine would do the
trick.

--
Poison [BLX]
Joshua M. Murphy

Gentoo user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.