This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # command | |
| mongo --port <port> --host <host ip> | |
| # example | |
| mongo --port 27017 --host 10.0.3.36 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # command | |
| ssh -L <local-host>:<local-port> <container-ip>:<container-port> <username>@<remote-host> | |
| # -L : indicates, local portforwarding | |
| # <local-host> : local machine ip, its optionl(default localhost) | |
| # <local-port> : local port to listen | |
| # <container-ip> : container/service ip | |
| # <container-port> : container/service port | |
| # <username> : username of remote host | |
| # <remote-host> : remote host ip | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # example | |
| ssh -L localhost:8888:172.17.42.1:15534 [email protected] | |
| # 8888 : local listening port | |
| # 172.17.42.1 : container ip(docker host) | |
| # 15534 : container serving port | |
| # pagero : remote host username | |
| # 10.4.1.41 : remote host ip | |
| # localhost is potional | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Host cmb_test | |
| HostName 10.4.1.41 | |
| User pagero | |
| LocalForward 7777 172.17.42.1:8443 | |
| LocalForward 8888 172.17.42.1:15534 | |
| LocalForward 212121 172.17.42.1:212121 | |
| # In here define three port forwading rules | |
| # ssh | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # add to /etc/hosts file | |
| 127.0.0.1 facebook.com | |
| 127.0.0.1 www.facebook.com | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # flush dscache to apply the /etc/hosts changes | |
| sudo dscacheutil -flushcache | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # jail directory | |
| mkdir ~/Workspace/research/jail | |
| # jail directory content | |
| cd ~/Workspace/research/jail | |
| mkdir usr | |
| mkdir bin | |
| mkdir etc | |
| mkdir lib | |
| mkdir lib64 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # structure | |
| sudo chroot <directory> <command> | |
| # directory - jailing directory | |
| # command - execuring command in the jail directory | |
| # example | |
| sudo chroot jail /bin/bash | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # jair dir | |
| cd ~/Workspace/research/jail | |
| # copy bash | |
| cp /bin/bash bin | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # command | |
| ldd <command> | |
| # example | |
| ldd /bin/bash |