OBDS-Training / Help

Documentation for the WIMM CCB
https://obds-training.github.io/Help/
MIT License
3 stars 1 forks source link

ssh to teaching cluster #265

Closed kevinrue closed 1 year ago

kevinrue commented 1 year ago

On local network

Set up your WIMM IT password (https://management.imm.ox.ac.uk/).

ssh abcd1234@imm-obds

When prompted type your WIMM IT password.

kevinrue commented 1 year ago

SSH config

Step 1. Create SSH key pair

ssh-keygen -t ecdsa -b 521

Step 2. Edit .ssh/config

Host obds
     HostName imm-obds
     User abcd1234
     IdentityFile ~/.ssh/id_ecdsa
     LocalForward localhost:8787 localhost:8787

Step 3. Copy SSH public key to imm-obds

ssh-copy-id -i ~/.ssh/id_ecdsa obds

You will be prompted for the password, possibly twice (logging in, adding the key).

Step 4. Connect to imm-obds

ssh obds
kevinrue commented 1 year ago

On VPN

Single command

ssh -J abcd1234@bastion.imm.ox.ac.uk abcd1234@imm-obds

Using SSH key

Step 1. Edit .ssh/config

Host bastion
    HostName bastion.imm.ox.ac.uk
    User abcd1234
    IdentityFile ~/.ssh/id_ecdsa

Host obds-bastion
    HostName imm-obds
    User abcd1234
    IdentityFile ~/.ssh/id_ecdsa
    # for RStudio
    LocalForward localhost:8787 localhost:8787
    # via Bastion
    ProxyCommand ssh abcd1234@bastion.imm.ox.ac.uk nc %h %p

Step 2. Copy SSH public key to bastion

ssh-copy-id -i ~/.ssh/id_ecdsa bastion

Notes:

Step 3. Copy SSH public key to imm-obds via bastion

ssh-copy-id -o ProxyJump=bastion obds

Notes:

Step 4. Connect to imm-obds via bastion

ssh obds-bastion

Note: The passphrase is asked twice.

liezeltamon commented 1 year ago

On VPN

Single command

ssh -J abcd1234@bastion.imm.ox.ac.uk abcd1234@imm-obds

Using SSH key

Step 1. Edit .ssh/config

Host bastion
    HostName bastion.imm.ox.ac.uk
    User abcd1234
    IdentityFile ~/.ssh/id_ecdsa

Host obds-bastion
    HostName imm-obds
    User abcd1234
    IdentityFile ~/.ssh/id_ecdsa
    # for RStudio
    LocalForward localhost:8787 localhost:8787
    # via Bastion
    ProxyCommand ssh abcd1234@bastion.imm.ox.ac.uk nc %h %p

Step 2. Copy SSH public key to bastion

ssh-copy-id -i ~/.ssh/id_ecdsa bastion

Notes:

  • Uses ssh config.

Step 3. Copy SSH public key to imm-obds via bastion

ssh-copy-id -o ProxyJump=bastion obds

Notes:

  • Uses ssh config.
  • The passphrase is asked three times (bastion, imm-obds, permission to add key).

Step 4. Connect to imm-obds via bastion

ssh obds-bastion

Note: The passphrase is asked twice.

This works for me! and can definitely simply bastion i.e.

ProxyCommand ssh bastion nc %h %p
github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 5 days with no activity.