Other links

Random (Thoughts?)

Although I am working with VDX.TV, I do a lot of pet projects in my spare time. It can include anything. In these works, I gain a lot of experience. Links to such recent experiences are given below.


Tricks in SSH

  1. Setup autologin to a remote host
    $ if [ ! -f ~/.ssh/id_rsa.pub ]; then ssh-keygen -t rsa; fi; cat ~/.ssh/id_rsa.pub | ssh <ssh options> <user>@<host> 'if [[ ! -d .ssh ]]; then mkdir .ssh; fi;cat >> .ssh/authorized_keys'

  2. Login to U1@H1:P1 via U2@H2:P2
    1. Old style, works only on linux with bsd style netcat
      $ ssh -o ProxyCommand="ssh -p P2 U2@H2 nc -q0 %h %p" -p P1 U1@H1
    2. New style, may require an updated version of SSH
      $ ssh -J U2@H2:P2 -p P1 U1@H1
      $ ssh -o ProxyJump U2@H2:P2 -p P1 U1@H1
      **Can add more jump by sperating using comman
  3. Login to U1@H1:P1 through U2@H2:P2 transparently
    1. Need to add info to the ~/.ssh/config

       Host aRandomName2
           User U1
           Port P1
           Hostname H1
       Host aRandomName1
           User U1
           Port P1
           Hostname H1
           ProxyJump aRandomName2
      • ssh to U1@H1:P1
        $ ssh aRandomName1
      • To open U1@H1:P1 from file browser, type sftp://aRandomName1 and enter