User Tools

Site Tools


ssh:tipsandtricks

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
ssh:tipsandtricks [2024/09/27 08:15] – [Example 2] jansenssh:tipsandtricks [2025/05/20 08:25] (current) – [Example 3] jansen
Line 23: Line 23:
 ==== Example 1 ==== ==== Example 1 ====
  
-Establish an SSH connection to a machine called <server>: ''<server>.strw.leidenuniv.nl'' via our SSH server ''ssh.strw.leidenuniv.nl''+Establish an SSH connection to a machine called <server>: ''SERVER.strw.leidenuniv.nl'' via our SSH server ''ssh.strw.leidenuniv.nl''
  
 <code bash> <code bash>
-ssh -o ProxyCommand="ssh -W %h:%p username@ssh.strw.leidenuniv.nl" username@<server>.strw.leidenuniv.nl+ssh -o ProxyCommand="ssh -W %h:%p username@ssh.strw.leidenuniv.nl" username@SERVER.strw.leidenuniv.nl
 </code> </code>
  
Line 47: Line 47:
 More recent versions of ssh (including ssh on MacOS) also have the option ''ProxyJump'' which has a somewhat easier syntax. When using that option, the examples become: On the commandline: More recent versions of ssh (including ssh on MacOS) also have the option ''ProxyJump'' which has a somewhat easier syntax. When using that option, the examples become: On the commandline:
 <code bash> <code bash>
-ssh -o ProxyJump="username@ssh.strw.leidenuniv.nl" username@<server>.strw.leidenuniv.nl+ssh -o ProxyJump="username@ssh.strw.leidenuniv.nl" username@SERVER.strw.leidenuniv.nl 
 +</code> 
 +or if your ssh client has the ''-J'' option: 
 +<code bash> 
 +ssh -J username@ssh.strw.leidenuniv.nl username@SERVER.strw.leidenuniv.nl
 </code> </code>
 +
  
 And in the ''.ssh/config'' file: And in the ''.ssh/config'' file:
 <code> <code>
 # cat $HOME/.ssh/config # cat $HOME/.ssh/config
-Host <server>.strw.leidenuniv.nl server+Host SERVER.strw.leidenuniv.nl SERVER
      Proxyjump ssh.strw.leidenuniv.nl      Proxyjump ssh.strw.leidenuniv.nl
      User username      User username
 </code> </code>
ssh/tipsandtricks.1727424944.txt.gz · Last modified: by jansen