This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| ssh:tipsandtricks [2023/01/06 20:40] – created deul | ssh:tipsandtricks [2025/05/20 08:25] (current) – [Example 3] jansen | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Remote Access to your Workstation | + | ====== Remote Access to your Server |
| - | For security reasons, access to your Observatory server is only possible within the Observatory intranet. Remote access can occur either securing your connection via an intermediate step called //SSH tunneling// (AKA //port forwarding// | + | For security reasons, access to your Observatory server is only possible within the Observatory intranet. Remote access can occur either securing your connection via an intermediate step called //SSH tunneling// (AKA //port forwarding// |
| Following are some examples that demonstrate the concept of SSH tunnelling. For alternative methods of connection, please see the relevant documentation. | Following are some examples that demonstrate the concept of SSH tunnelling. For alternative methods of connection, please see the relevant documentation. | ||
| - | SSH access to our servers requires you to set up [[strw: | + | 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 '' | + | 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 server.strw.leidenuniv.nl | + | 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 ==== | ||
| + | More recent versions of ssh (including ssh on MacOS) also have the option '' | ||
| + | <code bash> | ||
| + | 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 '' | ||
| + | < | ||
| + | # cat $HOME/ | ||
| + | Host SERVER.strw.leidenuniv.nl SERVER | ||
| + | | ||
| + | User username | ||
| + | </ | ||