This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ssh:tipsandtricks [2023/08/25 08:16] – jansen | ssh:tipsandtricks [2025/05/20 08:25] (current) – [Example 3] jansen | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| SSH access to our servers requires you to set up [[services: | SSH access to our servers requires you to set up [[services: | ||
| - | :!: The examples below have been tested with OpenSSH v7.3+. | + | :!: The examples below have been tested with OpenSSH v7.3+ on Linux; for MacOS, see example 3 below (which also works on recent Linux versions). |
| ===== SSH tunneling ===== | ===== SSH tunneling ===== | ||
| Line 23: | Line 23: | ||
| ==== Example 1 ==== | ==== Example 1 ==== | ||
| - | Establish an SSH connection to a machine called < | + | Establish an SSH connection to a machine called < |
| <code bash> | <code bash> | ||
| - | ssh -o ProxyCommand=" | + | ssh -o ProxyCommand=" |
| </ | </ | ||
| Line 37: | Line 37: | ||
| < | < | ||
| # cat $HOME/ | # cat $HOME/ | ||
| - | Host < | + | Host SERVER.strw.leidenuniv.nl |
| | | ||
| User username | User username | ||
| </ | </ | ||
| - | Once this configuration is in place, a simple '' | + | Once this configuration is in place, a simple '' |
| ==== Example 3 ==== | ==== Example 3 ==== | ||
| More recent versions of ssh (including ssh on MacOS) also have the option '' | More recent versions of ssh (including ssh on MacOS) also have the option '' | ||
| <code bash> | <code bash> | ||
| - | ssh -o ProxyJump=" | + | ssh -o ProxyJump=" |
| </ | </ | ||
| + | or if your ssh client has the '' | ||
| + | <code bash> | ||
| + | ssh -J username@ssh.strw.leidenuniv.nl username@SERVER.strw.leidenuniv.nl | ||
| + | </ | ||
| + | |||
| And in the '' | And in the '' | ||
| < | < | ||
| # cat $HOME/ | # cat $HOME/ | ||
| - | Host < | + | Host SERVER.strw.leidenuniv.nl |
| | | ||
| User username | User username | ||
| </ | </ | ||