Changeset 4823


Ignore:
Timestamp:
11/25/08 08:22:32 (8 years ago)
Author:
tick
Message:

A lazier script that help user to ssh in Neo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • developers/tick/scripts/sshn

    r4712 r4823  
    77} 
    88 
    9 spawn ssh -o stricthostkeychecking=no root@192.168.0.202 
    10 expect { 
    11     "Are you sure you want to continue connecting*"  
    12     {send "yes\r";exp_continue} 
    13     "root@*'s password:*" {send "\r\n";interact} 
     9 
     10while 1 { 
     11    spawn ssh -o stricthostkeychecking=no root@192.168.0.202 
     12    expect { 
     13        "Are you sure you want to continue connecting*"  
     14        {send "yes\r";exp_continue} 
     15        "root@*'s password:*" {send "\r\n";interact; exit} 
     16        -regexp {Offending[[:space:]]+key[[:space:]]+in[[:space:]]+/home/([[:alpha:]]+)/\.ssh/known_hosts:([[:digit:]]+)} { 
     17                    set whoami  "$expect_out(1,string)" 
     18                    set delline "$expect_out(2,string)" 
     19                    exec sed -i ${delline}d /home/${whoami}/.ssh/known_hosts 
     20                } 
     21    } 
    1422} 
Note: See TracChangeset for help on using the changeset viewer.