cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2500
Views
0
Helpful
2
Replies

How to pass password to copy running-config scp://root@x.x.x.x/locatio

vamsi2k11
Level 1
Level 1

I am trying to remote copy running config to a server using code.

Every time I try to access it, it asks for a known hosts file confirmation dialog box for a new server and a password dialog box.

Can we skip these 2 steps and pass password to the scp in uri format.

Kindly help me out on this.

2 Replies 2

marce1000
Hall of Fame
Hall of Fame

 

 - Can you try with : copy running-config scp://root:password@x.x.x.x/locatio...

 M.



-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
    When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '

Hello,

you could also configure an EEM script and then run the script whenever you want to backup the config using the command:

event manager run BACKUP_CFG_SCP

Action 8.0 and 9.0 are optional (if you use those, you also need to set the two environment variables at the top. IP addresses, usernames, and passwords obviously need to reflect your own.

event manager environment _email_server 192.168.1.33
event manager environment _email_to user@domain.com
!
event manager applet BACKUP_CFG_SCP
event none
action 1.0 info type routername
action 2.0 cli command "enable"
action 3.0 cli command "copy run scp:" pattern "Address"
action 4.0 cli command "192.168.1.10" pattern "username"
action 5.0 cli command "root" pattern "filename"
action 6.0 cli command "/backup/routers/$_info_routername-config" pattern "Password"
action 7.0 cli command "Passw0rd"
action 8.0 mail server "$_email_server" to "$_email_to" from "$_info_routername@domain.com" subject "SCP Backup completed" body "SCP Backup completed"
action 9.0 syslog priority informational msg "Config change detected. Copy to SCP succesfull"