Learn about Linux
Download Linux
Get Linux help
Get special offers on:
Linux Application Dev Programming Software
Email:
It's nice to launch VNC with the necessary password included on the command line. It's also nice to automate rsync without creating keys beforehand. Just be aware that of course it's not super-safe to let plaintext passwords in your<nobr> <wbr></nobr>.yourshell_history.<nobr> <wbr></nobr>;)
My 2 eurocents contributions (wich can surely be improved)<nobr> <wbr></nobr>:
autovncviewer
<tt>#!/bin/bash# Syntax : autovncviewer host password vncoption1 vncoption2<nobr> <wbr></nobr>...# Example : autovncviewer mypc "weakpwd" -bgr233 host="$1"password="$2"shiftshift [ -z "$TMP" ] && TMP=/tmp cat > $TMP/autovncviewer.expect.tmp.$$ << EOF#!/usr/bin/expect -fset host [lindex \$argv 0]set password [lindex \$argv 1]set timeout -1spawn vncviewer \$host $*expect "assword:"send "\$password\r"expect eofEOF chmod 700 $TMP/autovncviewer.expect.tmp.$$$TMP/autovncvie<nobr>w<wbr></nobr> er.expect.tmp.$$ "$host" "$password"rm $TMP/autovncviewer.expect.tmp.$$</tt>
<tt>#!/bin/bash# Syntax : autorsync password rsyncoption1 rsyncoption2<nobr> <wbr></nobr>...# Example : autorsync passwd -Pavz joe@machine1:/home/joe/data<nobr> <wbr></nobr>. password="$1"shift[ -z "$TMP" ] && TMP=/tmp cat > $TMP/autorsync.expect.tmp.$$ << EOF#!/usr/bin/expect -fset password [lindex \$argv 0]set timeout -1spawn rsync $*expect { "(yes/no)" { send "yes\r" expect "assword:" send "\$password\r" } "assword:" { send "\$password\r" }}expect eofEOF chmod 700 $TMP/autorsync.expect.tmp.$$$TMP/autorsync.expe<nobr>c<wbr></nobr> t.tmp.$$ "$password"echo $?rm $TMP/autorsync.expect.tmp.$$</tt>
#
Return to Automate interactive transactions with Expect
© Copyright 1999-2008 - SourceForge, Inc., All Rights Reserved About Linux.com - Privacy Statement - Terms of Use - Advertise - Trademark - Ask Linux Questions - Write for Us - RSS Feed ThinkGeek - Slashdot - SourceForge.net - freshmeat - Surveys - Jobs
Two examples : VNC and rsync
Posted by: Anonymous Coward on August 04, 2006 01:38 PMIt's nice to launch VNC with the necessary password included on the command line. It's also nice to automate rsync without creating keys beforehand.
Just be aware that of course it's not super-safe to let plaintext passwords in your<nobr> <wbr></nobr>.yourshell_history.<nobr> <wbr></nobr>;)
My 2 eurocents contributions (wich can surely be improved)<nobr> <wbr></nobr>:
autorsyncautovncviewer
#