![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ssh-keygen questions (not working) | tekline | UNIX for Advanced & Expert Users | 10 | 09-01-2008 09:17 PM |
| Passing the values to the secondary script when it invoked by primary script | venu_eie | Shell Programming and Scripting | 1 | 07-03-2008 06:16 AM |
| create a shell script that calls another script and and an awk script | magikminox | Shell Programming and Scripting | 0 | 06-26-2008 02:50 AM |
| Shell Script: want to insert values in database when update script runs | ring | Shell Programming and Scripting | 1 | 10-25-2007 03:06 AM |
| ssh-keygen trust problem | PaulC | SuSE | 4 | 04-21-2005 09:17 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
SSH-Keygen script
Hello friends,
I wanna to make new script which work as i defined below (1) it connect (using ssh) to remote server (2) remote server having passphrase key with password (3) Generate new passphrase on local machine with random 8 character password. (4) It will atomatically uploaded to the remote server & mail send to specified users with new password. I need some help from you guys to complete this script. now i am stucked at the point of providing password while generating script. can anybody tell me how can i provide password to the script ........................??????????? ![]() |
|
||||
|
Use autoexpect
# autoexpect <return> #scp/ssh xxx@xx <return> #password:***** #ctrl d it will automatically generate script.exp in the current directory and u can call that script from shell script. Basically autoexpect logs key strokes and generates the script. Hope this helps |
|
||||
|
####################my_shell_script.exp #################
#!/usr/bin/expect -f exp_internal 1 spawn /usr/bin/scp -i /root/Test/abcds test.txt root@192.168.1.6:/tmp/ expect "*?assword:*" send "pass_word\r" send -- "\r" expect eof ###################Output ########################### spawn /usr/bin/scp -i /root/Test/abcds test.txt root@192.168.1.6:/tmp/ parent: waiting for sync byte parent: telling child to go ahead parent: now unsynchronized from child spawn: returns {4384} expect: does "" (spawn_id exp7) match glob pattern "*?assword:*"? no expect: timed out send: sending "pass_word\r" to { exp7 } send: sending "\r" to { exp7 } pass_word expect: timed out can anybody guide me whats wrong in this script ? Thanks In Advance Last edited by jagnikam; 10-10-2008 at 04:06 PM.. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|