OpenWrt Forum Archive

Topic: SCP Scripting

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm trying to write a script to scp a file to a remote server. The only problem i'm having is with the password. Anyone know how to SCP without a password (or specify it as a paramater)?

eatnumber1 wrote:

I'm trying to write a script to scp a file to a remote server. The only problem i'm having is with the password. Anyone know how to SCP without a password (or specify it as a paramater)?

You must add the user public key to server authorised keys list (~/.ssh/authorized_keys2):
http://www.linux-mag.com/2004-07/tech_support_01.html

yes, i saw that. The problem with is that it allows me to ssh into the router, but not from it. I am trying to write a script ON the router to scp to my linux server. And openwrt dosen't seem to have any way to generate a key.

eatnumber1 wrote:

yes, i saw that. The problem with is that it allows me to ssh into the router, but not from it. I am trying to write a script ON the router to scp to my linux server. And openwrt dosen't seem to have any way to generate a key.

Generate these keys with some other system and just import these to the running OpenWRT. It should work.

i did that, but that allows for connections going FROM my server TO the router. I want to allow connections FROM my router TO my server

eatnumber1 wrote:

i did that, but that allows for connections going FROM my server TO the router. I want to allow connections FROM my router TO my server

There shouldn't be any difference. Put the router root user public key into your server user ~/.ssh/authorized_keys2 file and you'll be fine.

where can i find the router root user public key?

The discussion might have continued from here.