JaneNY
JaneNY

Reputation: 11

Upload file with SCP bash script

I need bash script to upload file with SCP. How I can do that in script, I want to call that script fromother program. ( I know to do that with EXPECT but I need plain bash script). Can anybody help ?

Upvotes: 0

Views: 1787

Answers (2)

sarnold
sarnold

Reputation: 104050

I strongly recommend setting up key-based authentication for your system. Then you could use ssh-agent to automate unlocking the key for your program.

Upvotes: 3

aioobe
aioobe

Reputation: 420971

I need bash script to upload file with SCP

Well then just type the scp command in the file and make it executable.

If you're asking how to avoid being prompted for password, I strongly recommend you to use SSH-keys. Here is a really simple tutorial on how to set it up properly.

Upvotes: 1

Related Questions