[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1138
  • Last Modified:

Linux, scripts, scp, and eliminating password authentication

I am using RHEL 6.4   (Note:  my previous posts on this subject involved ssh, not scp)

I can get the scp utility to work well as in:

scp test.file root@xxclnt2:/home

Open in new window


However, I am required to enter a passowrd

I want to write a script that will perform 20 scp commands to 20 different systems

How can I do this with scp

Thanks
0
Los Angeles1
Asked:
Los Angeles1
  • 2
1 Solution
 
Los Angeles1Author Commented:
I meant so toy, how can I do this without entering a password

Thanks
0
 
Los Angeles1Author Commented:
Or is that possible ?
0
 
omarfaridCommented:
yes, it is possible. You need to set trust between the systems' users (basically ssh or scp without password based on keys). Please how to do so in the link below

http://www.linuxproblem.org/art_9.html

Then you can set a loop to do scp like

cat hostsfile | while read host
do
    scp test.file root@$host:/home
done
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now