Find the answer to your Linux question:
Results 1 to 3 of 3
Hi folks, i would like to write a script for secure copy. Please help me in writing. Once script executes the scp command then, command prompt prompts for password. I ...
  1. #1
    Just Joined!
    Join Date
    Dec 2006
    Posts
    5

    shell script for scp

    Hi folks,
    i would like to write a script for secure copy. Please help me in writing. Once script executes the scp command then, command prompt prompts for password. I wud like to automate this with a script. How to provide the password to the prompt using the script?

    --Ganesh.

  2. #2
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,789
    There is no way to set the password in the script. The only way to get the script to automatically scp would be to use Authorised keys that allows the client to ssh into the server without specifying a password.

    As for how to do it, bash is the best way, all bash scripts start off with:
    Code:
    #!/bin/bash
    as the first line. Then it's a simple case of putting in the commands in the order that you want to do to get a simple script.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  3. #3
    Just Joined!
    Join Date
    Dec 2006
    Posts
    5
    Thank U sdousley.

    --Ganesh.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...