FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


fhscripts:fh:fhssh.sh.html



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
fhscripts:fh:fhssh.sh.html [2017/12/31 23:37]
kurihara
fhscripts:fh:fhssh.sh.html [2019/02/12 23:20] (current)
kurihara
Line 1: Line 1:
 [[:index.html#FastHandle Scripts|FastHandle Scripts]] [[:index.html#FastHandle Scripts|FastHandle Scripts]]
-====== fhssh.sh - auto login script======+====== SSH Auto Login Script without Password (fhssh.sh)======
  
 $FHHOME/fhscripts/fhssh.sh $FHHOME/fhscripts/fhssh.sh
Line 8: Line 8:
  
  
-===== Operation =====+===== fhssh.sh Operation =====
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-$ fhssh.sh 192.168.0.10+$ fhssh.sh -H 192.168.0.10  auth.pro 
 +$ fhssh.sh -H 192.168.0.11  auth.stg 
 +</sxh> 
 + 
 +== Application Example == 
 +<sxh bash toolbar:false gutter:false> 
 +~]$ fhssh.sh -l 
 +How to use 
 +  fhssh.sh -H x.x.x.x  auth.pro 
 +  fhssh.sh -H x.x.x.x  auth.stg 
 +  fhssh.sh -H x.x.x.x  auth.dev 
 +  fhssh.sh -H x.x.x.x  auth.srx_pro 
 +  fhssh.sh -H x.x.x.x  auth.srx_dev 
 +~]$
 </sxh> </sxh>
  
Line 22: Line 35:
 #===================================================================== #=====================================================================
 # fhssh.sh # fhssh.sh
-+#
 # How to use # How to use
-#    fhssh.sh  xx.xx.xx.xx+#    fhssh.sh  -l   <- list command 
 +#    fhssh.sh  -h 
 +#    fhssh.sh  -H xx.xx.xx.xx  auth.pro 
 +#    fhssh.sh  -H xx.xx.xx.xx  auth.stg
 #===================================================================== #=====================================================================
  
-if [ -z $1 ]; then +HELP () { 
-    echo 'ERROR:  $1 argument is null+    echo "How to use" 
-    echo 'How to use:' +    cat $0 |grep auth |grep ")"|grep -v "fhssh.sh" |awk -F")" {'print "  fhssh.sh -H x.x.x.x"  $1'
-    echo 'fhssh.sh 192.168.0.10'+    exit 0 
 +
 + 
 +ERROR () { 
 +    echo "" 
 +    echo 'ERROROption is mistake
 +    echo "" 
 +
 + 
 +case ${1} in 
 +  -h|-l) HELP 
 +     ;; 
 +esac 
 + 
 +if [ -z ${3} ]; then 
 +    ERROR 
 +    HELP
     exit 1     exit 1
 fi fi
  
-HOST=$1+case ${1} in 
 +  -H) : 
 +    HOST=$
 +    AUTH=$3 
 +     ;; 
 +  *) : 
 +    ERROR 
 +    HELP 
 +    exit 1 
 +    ;; 
 +esac
  
-------------------------------------------+#=================================================================== 
 +
 +#===================================================================
 SSH_PASS () { SSH_PASS () {
  
Line 89: Line 133:
  
  
-cat <<MENU +case ${AUTH} in 
-===================================================================== +  auth.pro
-Select Number or character +     USER=user01
---------------------------------------------------------------- +
-   1) production  user01   password atuh +
-   2) stating  user01 +
-   3) test  user01 +
-   a) SRX  production +
-   b) SRX  staging +
-   c) SRX  qa +
-   q) quit +
-===================================================================== +
-MENU +
- +
-echo -n -e "\t >" +
-read NUM +
-case ${NUM} in +
-  1) USER=user01+
      PASSWD=testpass      PASSWD=testpass
      SSH_PASS      SSH_PASS
     ;;     ;;
-  2) USER=user01+  auth.stg
 +     USER=user01
      PASSWD=testpass      PASSWD=testpass
      KEY=/home/xxx/.ssh/xxxx.pub      KEY=/home/xxx/.ssh/xxxx.pub
      SSH_KEY_NOPASS      SSH_KEY_NOPASS
     ;;     ;;
-  3) USER=user01+  auth.dev
 +     USER=user01
      PASSWD=testpass      PASSWD=testpass
      SSH_KEY_PASS      SSH_KEY_PASS
     ;;     ;;
-  a) USER=user01+  auth.srx_pro
 +     USER=user01
      PASSWD=testpass      PASSWD=testpass
      SRX      SRX
     ;;     ;;
-  b) USER=user01+  auth.srx_dev
 +     USER=user01
      PASSWD=testpass      PASSWD=testpass
      SRX      SRX
     ;;     ;;
-  c) USER=user01 
-     PASSWD=testpass 
-     SRX 
-    ;; 
-  q|Q) exit 
-     ;; 
-  *) echo "ERROR : selection is missed." 
-     exit 
-     ;; 
 esac esac
  
Line 145: Line 169:
 \\ \\
 <WRAP box 90%> <WRAP box 90%>
-<catlist -noAddPageButton -smallHead -sortAscending>+<catlist ..: -noAddPageButton -smallHead -sortAscending  -sortAscending>
 </WRAP> </WRAP>
  


fhscripts/fh/fhssh.sh.html.1514731036.txt.gz · Last modified: 2017/12/31 23:37 by kurihara