User Tools

Site Tools


scripting:bash

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
scripting:bash [2021/02/11 08:19] jotasandokuscripting:bash [2023/11/02 14:38] (current) – external edit 127.0.0.1
Line 9: Line 9:
   #run ssh agent   #run ssh agent
   ssh-add ~/.ssh/* >/dev/null 2>&1   ssh-add ~/.ssh/* >/dev/null 2>&1
 +
 +__EXAMPLE OF ssh/config FILE__:\\
 +  $ cat .ssh/config 
 +  Host *
 +    AddKeysToAgent yes
 +    #UseKeychain yes
 +    ServerAliveCountMax 6
 +    ServerAliveInterval 10
 +    TCPKeepAlive yes
 +    ForwardAgent yes
 +    Compression yes
 +    GatewayPorts yes
 +    StrictHostKeyChecking no
 +    User jaime.santos.amandi
 +  
 +  ## This is saying for anything for those IP ranges or for domains  myorgdatacloud.com OR myorgdatacloud.com EXCEPT anything starting with bastion-62
 +  ## use socks proxy over that host: bastion-lhr.myorgdatacloud.com
 +  Host 10.32.* 10.33.* *.myorgdatacloud.com *.bigshot.co.uk !bastion-62-*
 +    ProxyCommand ssh bastion-lhr.myorgdatacloud.com -W %h:%p
 +
 +
 +
 +
 +----
 +
 +BASH CONDITIONS:\\
  
      
Line 114: Line 140:
  
 Apply to multiple hosts with no need for a script: Apply to multiple hosts with no need for a script:
-  for i in admin-worker00.dc.grapeshot.co.uk \ +  for i in admin-worker00.dc.mycompany1.co.uk \ 
-  centosGUI.dc.grapeshot.co.uk \ +  centosGUI.dc.mycompany1.co.uk \ 
-  dbtest.dc.grapeshot.co.uk \ +  dbtest.dc.mycompany1.co.uk \ 
-  redis-admin.dc.grapeshot.co.uk \ +  redis-admin.dc.mycompany1.co.uk \ 
-  security-scanner01.dc.grapeshot.co.uk \ +  security-scanner01.dc.mycompany1.co.uk \ 
-  test.dc.grapeshot.co.uk \ +  test.dc.mycompany1.co.uk \ 
-  test01.dc.grapeshot.co.uk ; \+  test01.dc.mycompany1.co.uk ; \
   do ssh root@"$i" "ping -c 1 10.33.1.4"  ; done    do ssh root@"$i" "ping -c 1 10.33.1.4"  ; done 
      
Line 156: Line 182:
   echo -e "   echo -e "
   Host $val1   Host $val1
-       HostName $val1.dc.grapeshot.co.uk+       HostName $val1.dc.mycompany1.co.uk
        User jaime_santos        User jaime_santos
        Port 22";        Port 22";
Line 354: Line 380:
  
 **TO EVALUATE COMMANDS REMOTELY (SSH)** **TO EVALUATE COMMANDS REMOTELY (SSH)**
-  ssh root@jaguar27.dc.grapeshot.co.uk "/usr/bin/sed -i '/^IPADDR=/d' /etc/sysconfig/network-scripts/ifcfg-bond0"+  ssh root@jaguar27.dc.mycompany1.co.uk "/usr/bin/sed -i '/^IPADDR=/d' /etc/sysconfig/network-scripts/ifcfg-bond0"
      
  
scripting/bash.1613031553.txt.gz · Last modified: (external edit)