FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 05-03-2012, 11:44 AM
LiangYun Gong
 
Default 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
 
Old 05-03-2012, 01:20 PM
Adam Carter
 
Default SCP bash script

On Thu, May 3, 2012 at 9:44 PM, LiangYun Gong <kit393@gmail.com> 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.
 
Old 05-03-2012, 03:52 PM
LiangYun Gong
 
Default SCP bash script

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@gmail.com> wrote:

On Thu, May 3, 2012 at 9:44 PM, LiangYun Gong <kit393@gmail.com> 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.
 
Old 05-04-2012, 12:28 AM
Joshua Murphy
 
Default SCP bash script

On Thu, May 3, 2012 at 7:44 AM, LiangYun Gong <kit393@gmail.com> 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
 

Thread Tools




All times are GMT. The time now is 08:25 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org