Forum Discussion
F5 Auto backup script for SCP for V12
All,
I have deployed one script in F5 for Auto backup script for SCP for V12.
Script:
!/bin/bash /admin/home/bigipbackup.sh UCS Files will be saved to /var/local/ucs/ Create current date/time stamp variableDATETIME="
date +%Y_%m_%d
"
Note the correct ` character must be used above,
this can be found near the top left of most keyboards
just under the [ESCAPE] key.
Uncomment the following line for troubleshooting
echo $DATETIME
Create filename variable
UCS_FILENAME="${DATETIME}_$HOSTNAME"
Uncomment the following line for troubleshooting echo $UCS_FILENAME Create a UCS archive with the filename specified above The file extension will be .ucs � will be available in the GUItmsh save sys ucs "${UCS_FILENAME}"
If you don�t delete these files /var will become full fairly quickly Change the +31 value (31 days) to whatever suits you find /var/local/ucs/ �mtime 21 -deletescp "/var/local/ucs/${UCS_FILENAME}.ucs" abcd@1.2.3.4:/
EOFIt's asking the password for the remote server, this is defeating the automation purpose. I want that in every five minutes ucs file will generate and without any password promt it will send ucs file to the remote server.
Can someone pls tell me how this can be achieve?
7 Replies
- Phips_306701
Nimbostratus
Hey,
you can do this with ssh-key authentication. https://unix.stackexchange.com/questions/182483/scp-without-password-prompt-using-different-username
- Samir_Jha_52506
Noctilucent
Yes, Its possible. You can configure Public SSH Key to Remote Server.
So many document you will find in google.
https://www.howtogeek.com/168147/add-public-ssh-key-to-remote-server-in-a-single-command/
- Suresh_Jo_32729
Nimbostratus
Thanks for sharing the docs, I tried to follow the steps mentioned in the above docs.
The remote server in which I want to transfers the files is windows server and my F5 is running on linux version(Linux version 2.6.32-431.56.1.el6.)
First I tried to shared the keys by command line. I got below error.
abcd@1.2.3.4's password: exec request failed on channel 0 <<<<<<
Then I did scp to transfer the keys from F5 to window server.
.ssh scp /root/.ssh/id_rsa.pub abcd@1.2.3.4:/ abcd@1.2.3.4's password: id_rsa.pub 100% 420 0.4KB/s 00:00
It was successful but after that when I tried to run my script got same problem, password prompt.
admin bash bigipbackup.sh Saving active configuration... /var/local/ucs/date_xyz.ucs.ucs is saved. abcd@1.2.3.4's password: date_xyz.ucs.ucs 100% 6677KB 6.5MB/s 00:01
Any suggestion how password prompt can be avoid?
- Suresh_Jo_32729
Nimbostratus
Hello,
Is it possible to scp (transfer) files from linux (F5) machine to the window server?
- Suresh_Jo_32729
Nimbostratus
Hello,
Can someone pls confirm me if, Is it possible to scp (transfer) files from linux (F5) machine to the window server?
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com