Secure Copy or SCP is a means of securely transferring computer files between a local and a remote host or between two remote hosts. It is based on the Secure Shell (SSH) protocol. When we use this command, we must prompt password to copy file from other host. We can use upload public key for automatic, but we can use other method to bypass input password.
Expect is a useful tool for feeding inputs automatically to an interactive program. Expect is a program that “talks” to other interactive programs accord‐ing to a script. This is a sample code to bypass password when use scp command :
set timeout 30
spawn /usr/bin/scp /home/toto/rsfrunning.sh firstname.lastname@example.org:/home/angel/
This is a simple script to bypass command from konsole. You can use other command (ex. ssh, ftp, etc) with expact, so you can bypass other parameter from that command.Source : http://wiki.tcl.tk/11583 http://myithaca.wordpress.com/2009/06/21/expect-scripting-tutorial/
My name is Toto Sugito. This is my notes when I try something. Maybe, this is NOT THE BEST SOLUTION for your problems. If you have other method or idea that better with my post, please share in this blog. Thank for visiting my site.