software:vscode:darwin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
software:vscode:darwin [2024-03-28 11:09] anitasoftware:vscode:darwin [2024-04-26 17:35] – [Using SSH keys] anita
Line 21: Line 21:
     "remote.SSH.localServerDownload": "off",     "remote.SSH.localServerDownload": "off",
     "remote.SSH.lockfilesInTmp": true,     "remote.SSH.lockfilesInTmp": true,
 +    "remote.SSH.useLocalServer": true,
 +    "remote.SSH.useExecServer": false,
     "remote.SSH.enableRemoteCommand": true     "remote.SSH.enableRemoteCommand": true
 </code> </code>
Line 43: Line 45:
 {{:software:vscode:vscode-7.png?400|}} {{:software:vscode:vscode-7.png?400|}}
  
-It will open the Config file located in the path specified by ''~/vscode-remote-ssh/config''. You can have multiple configurations used for DARWIN with different host names. For example, in the following Config file, ''Host DARWIN'' starts the interactive job on ''idle'' partition and request one CPU for the remote shell to use. ''Host DARWINGPU'' request to use the GPU and ''Host DARWINMPI'' can be used for MPI. +It will open the Config file located in the path specified by ''~/vscode-remote-ssh/config''. You can have multiple configurations used for DARWIN with different Host definitions. For example, in the following Config file, ''Host DARWIN'' starts the interactive job on ''it_css'' partition and requests one CPU for the remote shell to use. ''Host DARWINGPU'' requests to use GPU and ''Host DARWINMPI'' can be used for MPI. 
  
 For this example,  the Config file ''~/vscode-remote-ssh/config'' contains the following definitions (remember User ''traine'' should be replace with your username as well as possible partition and other options) For this example,  the Config file ''~/vscode-remote-ssh/config'' contains the following definitions (remember User ''traine'' should be replace with your username as well as possible partition and other options)
Line 118: Line 120:
 </note> </note>
  
-==== Using SSH keys ==== 
-SSH public key authentication is a secure way to authenticate with an SSH host by combining a local "private" key with a "public" key associated with your user account. Once you set up the SSH keys, you will not need to enter the password for every login. Please only generate the SSH keys on the trusted computer. For macOS / Linux, you can run the following command in a local terminal: 
-<code> 
-ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519-remote-darwin 
-export USER_AT_HOST="your-user-name@darwin.hpc.udel.edu" 
-export PUBKEYPATH="$HOME/.ssh/id_ed25519-remote-darwin.pub" 
-ssh-copy-id -i "$PUBKEYPATH" "$USER_AT_HOST" 
-</code> 
-For Windows, run the following command in a local PowerShell as administrator: 
-<code> 
-ssh-keygen -t ed25519 -f "$HOME\.ssh\id_ed25519-remote-darwin.pub" 
-$USER_AT_HOST="your-user-name@darwin.hpc.udel.edu" 
-$PUBKEYPATH="$HOME\.ssh\id_ed25519-remote-darwin.pub" 
- 
-$pubKey=(Get-Content "$PUBKEYPATH" | Out-String); ssh "$USER_AT_HOST" "mkdir -p ~/.ssh && chmod 700 ~/.ssh && echo '${pubKey}' >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys" 
- 
-</code> 
- 
-Open VSCode and run "Remote-SSH: Open Configuration File" in the Command Palette (F1). Then, select ''~/vscode-remote-ssh/config'' and add or modify a host entry as shown below: 
- 
-<code> 
-Host DARWIN 
-    HostName darwin.hpc.udel.edu 
-    User traine 
-    Forwardx11 no 
-    ForwardX11Trusted no 
-    RemoteCommand vscode-shell-proxy -g it_css --salloc-arg=--partition=idle --salloc-arg=--cpus-per-task=4 
-    IdentityFile ~/.ssh/id_ed25519-remote-darwin 
-</code> 
  
-For more information, please refer to [[https://code.visualstudio.com/docs/remote/troubleshooting|SSH tips]]. 
 ==== Connect VSCode to compute node ==== ==== Connect VSCode to compute node ====
 Now, we can connect the VSCode to the compute node. Follow the similar steps when adding the Config file from the [[:software:vscode:darwin#setting-up-remote-connections|Setting up Remote Connections]] except step 3. Since we created the host named "DARWIN", choose it and enter the credentials for DARWIN login (or [[software:vscode:darwin#using-ssh-keys| use SSH keys]]).  Now, we can connect the VSCode to the compute node. Follow the similar steps when adding the Config file from the [[:software:vscode:darwin#setting-up-remote-connections|Setting up Remote Connections]] except step 3. Since we created the host named "DARWIN", choose it and enter the credentials for DARWIN login (or [[software:vscode:darwin#using-ssh-keys| use SSH keys]]). 
  • software/vscode/darwin.txt
  • Last modified: 2024-04-26 17:35
  • by anita