Changes

Jump to navigation Jump to search
400 bytes added ,  09:03, 31 January 2020
m
Line 44: Line 44:  
===Check/close open tunnels===
 
===Check/close open tunnels===
 
  <nowiki>
 
  <nowiki>
  netstat -n --protocol inet | grep ':22'
+
    netstat -n --protocol inet | grep ':22'
  sudo lsof -i -n | egrep '\<ssh\>'
+
    sudo lsof -i -n | egrep '\<ssh\>'
  sudo lsof -i -n | egrep '\<sshd\>'</nowiki>
+
    sudo lsof -i -n | egrep '\<sshd\>'</nowiki>
    
'''To close open tunnels'''<br />
 
'''To close open tunnels'''<br />
Line 90: Line 90:  
===$HOME/.ssh/config===
 
===$HOME/.ssh/config===
 
  <nowiki>Host morpheus
 
  <nowiki>Host morpheus
      IdentityFile ~/.ssh/Trinity.pub
+
        IdentityFile ~/.ssh/Trinity.pub
      User rafa
+
        User rafa
      port 10535
+
        port 10535
 
+
   
  === $WORK/.ssh/config ===
+
    === $WORK/.ssh/config ===
  Host flirt
+
    Host flirt
      IdentityFile ~/.ssh/Trinity.pub
+
        IdentityFile ~/.ssh/Trinity.pub
      User rafa
+
        User rafa
      port 10536</nowiki>
+
        port 10536</nowiki>
    
(connections config)
 
(connections config)
 
  <nowiki>Host fpsim-frontend
 
  <nowiki>Host fpsim-frontend
      IdentityFile ~/.ssh/DNC-FKY.pem
+
        IdentityFile ~/.ssh/DNC-FKY.pem
 
+
   
  Host *
+
    Host *
      ServerAliveInterval 30
+
        ServerAliveInterval 30
      ServerAliveCountMax 2
+
        ServerAliveCountMax 2
 
+
   
  Host mi6.rra.lan
+
    Host mi6.rra.lan
      IdentityFile ~/.ssh/rra_fake.pem
+
        IdentityFile ~/.ssh/rra_fake.pem
      User rra
+
        User rra
 
+
   
  Host leaks.rra.lan
+
    Host leaks.rra.lan
      IdentityFile ~/.ssh/rt_rsa
+
        IdentityFile ~/.ssh/rt_rsa
      User xe50582
+
        User xe50582
 
+
   
  Host news.menupayapp.com
+
    Host news.menupayapp.com
      IdentityFile ~/.ssh/rra_id.pem
+
        IdentityFile ~/.ssh/rra_id.pem
      User ubuntu
+
        User ubuntu
 
+
   
  Host 20.1.40.109
+
    Host 20.1.40.109
      IdentityFile ~/.ssh/rt_rsa
+
        IdentityFile ~/.ssh/rt_rsa
      User rra
+
        User rra
 
+
   
  Host gitrra.dyndns.org
+
    Host gitrra.dyndns.org
      IdentityFile ~/.ssh/DNC-FKY.pem
+
        IdentityFile ~/.ssh/DNC-FKY.pem
      User ubuntu
+
        User ubuntu
 
+
   
  Host mapper1
+
    Host mapper1
      IdentityFile ~/.ssh/id_rsa
+
        IdentityFile ~/.ssh/id_rsa
      HostName WF00MPA1.igrupobbva
+
        HostName WF00MPA1.igrupobbva
      User pi
+
        User pi
 
+
   
  Host mapper2
+
    Host mapper2
      IdentityFile ~/.ssh/id_rsa
+
        IdentityFile ~/.ssh/id_rsa
      HostName WF00MPA2.igrupobbva
+
        HostName WF00MPA2.igrupobbva
      User pi
+
        User pi
 
+
   
 
+
   
 
+
   
  # LEAVE THIS ONES AT THE BOTTOM (WILDCHARS) First match will be used  
+
    # LEAVE THIS ONES AT THE BOTTOM (WILDCHARS) First match will be used  
  Host 20.1.40.*
+
    Host 20.1.40.*
      IdentityFile ~/.ssh/rt_rsa
+
        IdentityFile ~/.ssh/rt_rsa
      User xe50582
+
        User xe50582
 
+
   
  Host *.rra.lan
+
    Host *.rra.lan
      IdentityFile ~/.ssh/rt_rsa
+
        IdentityFile ~/.ssh/rt_rsa
      User xe50582
+
        User xe50582
 
+
   
 
+
   
  Host 10.255.0.*
+
    Host 10.255.0.*
      IdentityFile ~/.ssh/rt_rsa
+
        IdentityFile ~/.ssh/rt_rsa
      User xe50582</nowiki>
+
        User xe50582</nowiki>
    
==LDAP ldapkeyfile==
 
==LDAP ldapkeyfile==
Line 178: Line 178:  
create file: /home/user/.ssh/config with the following content: (client side) chmod 600
 
create file: /home/user/.ssh/config with the following content: (client side) chmod 600
 
  <nowiki>
 
  <nowiki>
    Host *
+
    Host *
        ServerAliveInterval 60
+
        ServerAliveInterval 60
        ServerAliveCountMax 2</nowiki>
+
        ServerAliveCountMax 2</nowiki>
 
For each user, or ading to /etc/ssh/ssh_config
 
For each user, or ading to /etc/ssh/ssh_config
 
  ServerAliveInterval 60
 
  ServerAliveInterval 60
Line 191: Line 191:  
2:
 
2:
 
  <nowiki>
 
  <nowiki>
  echo 60 > /proc/sys/net/ipv4/tcp_keepalive_time</nowiki>
+
    echo 60 > /proc/sys/net/ipv4/tcp_keepalive_time</nowiki>
    
Shell script to reconnect on broken pipe:
 
Shell script to reconnect on broken pipe:
Line 246: Line 246:  
Path ~/.ssh/config
 
Path ~/.ssh/config
   −
== Kill User sessions ==
+
==Kill User sessions==
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
ps aux | grep xe84049 | grep sshd | awk '{print $2}' | xargs -n 1 sudo kill -9
 
ps aux | grep xe84049 | grep sshd | awk '{print $2}' | xargs -n 1 sudo kill -9
Line 253: Line 253:  
===Work===
 
===Work===
 
  <nowiki>Host fpsim-frontend
 
  <nowiki>Host fpsim-frontend
      IdentityFile ~/.ssh/DNC-FKY.pem
+
        IdentityFile ~/.ssh/DNC-FKY.pem
      User ubuntu
+
        User ubuntu
  Host *
+
    Host *
      ServerAliveInterval 30
+
        ServerAliveInterval 30
      ServerAliveCountMax 2
+
        ServerAliveCountMax 2
 
+
   
  Host 10.255.0.*
+
    Host 10.255.0.*
      IdentityFile ~/.ssh/rt_rsa
+
        IdentityFile ~/.ssh/rt_rsa
      User xe50582
+
        User xe50582
 
+
   
  Host leaks.rra.lan
+
    Host leaks.rra.lan
      IdentityFile ~/.ssh/rt_rsa
+
        IdentityFile ~/.ssh/rt_rsa
      User xe50582
+
        User xe50582
 
+
   
  Host news.menupayapp.com
+
    Host news.menupayapp.com
      IdentityFile ~/.ssh/rra_id.pem
+
        IdentityFile ~/.ssh/rra_id.pem
      User ubuntu
+
        User ubuntu
 
+
   
  Host 20.1.40.109
+
    Host 20.1.40.109
      IdentityFile ~/.ssh/rt_rsa
+
        IdentityFile ~/.ssh/rt_rsa
      User rra
+
        User rra
 
+
   
  Host 20.1.40.*
+
    Host 20.1.40.*
      IdentityFile ~/.ssh/rt_rsa
+
        IdentityFile ~/.ssh/rt_rsa
      User xe50582
+
        User xe50582
 
+
   
 
+
   
  Host pdgrt.rra.lan
+
    Host pdgrt.rra.lan
      User rra
+
        User rra
 
+
   
 
+
   
  host geoip.dyndns.org
+
    host geoip.dyndns.org
      IdentityFile ~/.ssh/rra_springfield.pem
+
        IdentityFile ~/.ssh/rra_springfield.pem
      User ubuntu
+
        User ubuntu
 
+
   
  host rrafara.dyndns.org
+
    host rrafara.dyndns.org
      IdentityFile ~/.ssh/DNC.pem
+
        IdentityFile ~/.ssh/DNC.pem
      User ubuntu
+
        User ubuntu
 
+
   
  host deathnote.rra.lan
+
    host deathnote.rra.lan
      User rra
+
        User rra
 
+
   
  host savvius.rra.lan
+
    host savvius.rra.lan
      User root
+
        User root
 
+
   
 
+
   
  Host *.rra.lan
+
    Host *.rra.lan
      # IdentityFile ~/.ssh/rt_rsa
+
        # IdentityFile ~/.ssh/rt_rsa
      User xe50582
+
        User xe50582
 
+
   
 
+
   
  Host 10.255.0.32
+
    Host 10.255.0.32
      IdentityFile ~/.ssh/rra_fake.pem
+
        IdentityFile ~/.ssh/rra_fake.pem
      user rra
+
        user rra
 
+
   
  Host aws-gitlab
+
    Host aws-gitlab
      IdentityFile ~/.ssh/DNC-FKY.pem
+
        IdentityFile ~/.ssh/DNC-FKY.pem
      User ubuntu
+
        User ubuntu
  </nowiki>
+
    </nowiki>
 
===Trinity===
 
===Trinity===
<nowiki>Host *.herrerosolis.com
+
<syntaxhighlight lang="bash">
      IdentityFile ~/.ssh/whispers.pem
+
PreferredAuthentications password
      User ubuntu
+
PubkeyAuthentication no
 
+
 
  Host geoip.dyndns.org
+
Host *.herrerosolis.com
      IdentityFile /media/rafa/secrets/.ssh/rra_springfield
+
    IdentityFile ~/.ssh/whispers.pem
      User ubuntu
+
    User ubuntu
 
+
 
  Host morpheus
+
Host herrerosolis.com
      IdentityFile ~/.ssh/Trinity.pub
+
    IdentityFile ~/.ssh/whispers.pem
      User rafa
+
    User ubuntu
      Port 10535
+
 
 
+
Host git.herrerosolis.com
  Host flirt
+
    IdentityFile ~/.ssh/whispers.pem
      IdentityFile ~/.ssh/Trinity.pub
+
    User ubuntu
      User rafa
+
 
      Port 10536
+
Host geoip.dyndns.org
 
+
    IdentityFile /media/rafa/secrets/.ssh/rra_springfield
  Host kodi
+
    User ubuntu
      User root
+
 
      PreferredAuthentications password
+
Host morpheus.lan
      PubkeyAuthentication no
+
    IdentityFile ~/.ssh/Trinity.pub
 
+
    User rafa
 
+
    Port 10535
  #Host bitbucket.org
+
 
  #  IdentityFile ~/.ssh/cpc_bitbucket
+
Host flirt
 
+
    IdentityFile ~/.ssh/Trinity.pub
  Host peibol.duckdns.org
+
    User rafa
      User ubuntu
+
    Port 10536
      IdentityFile ~/.ssh/Trinity
+
 
 
+
Host pivpn*
  Host lightning01
+
    IdentityFile ~/.ssh/Trinity.pub
      User pi
+
    User pi
      IdentityFile ~/.ssh/Trinity
+
 
 
+
Host kodi.lan
  Host scripting-ssii.rra.lan
+
    User root
      User rra
+
    PreferredAuthentications password
 
+
    PubkeyAuthentication no
  Host *.rra.lan
+
 
      User xe50582
+
Host libreelec.lan
 
+
    User root
  Host felixnomada.duckdns.org
+
    PreferredAuthentications password
      User ubuntu
+
    PubkeyAuthentication no
      IdentityFile ~/.ssh/felixInteractions.pem
+
 
 
+
#Host bitbucket.org
  Host bitbucket.org
+
#  IdentityFile ~/.ssh/cpc_bitbucket
      IdentityFile ~/.ssh/bitbucket</nowiki>
+
 
 +
Host peibol.duckdns.org
 +
    User ubuntu
 +
    IdentityFile ~/.ssh/Trinity
 +
 
 +
Host lightning01
 +
    User pi
 +
    IdentityFile ~/.ssh/Trinity
 +
 
 +
Host scripting-ssii.rra.lan
 +
    User rra
 +
 
 +
Host *.rra.lan
 +
    User xe50582
 +
 
 +
Host felixnomada.duckdns.org
 +
    User ubuntu
 +
    IdentityFile ~/.ssh/felixInteractions.pem
 +
 
 +
Host bitbucket.org
 +
    IdentityFile ~/.ssh/bitbucket
 +
</syntaxhighlight>

Navigation menu