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 <adamcart...@gmail.com> wrote: > On Thu, May 3, 2012 at 9:44 PM, LiangYun Gong <kit...@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. > >