Skip to content

Latest commit

 

History

History
81 lines (65 loc) · 3.42 KB

README.md

File metadata and controls

81 lines (65 loc) · 3.42 KB

setup-vscode

How to set up Visual Studio Code locally and connect to remote system

Prerequisites

  • Get your IBM i credentials from Yoda

Installs

Install the following on your Windows computer:

Set up Visual Studio Code

When you see %%IBM i Profile%% in the instructions, replace with your IBM i user profile (replace the % too).
When you see %%Windows Username%% in the instructions, replace with your Windows user name (replace the %).
Whenever you see shell commands that you need to enter, they will start with "$". This is the command prompt that you will see in the terminal and is not part of the command; do not type the "$" as part of the commands!

Set the default shell

Open Visual Studio Code.
Press F1 to open the command prompt (displays at the top of the screen).
Type "Terminal: Select Default Shell" in the search bar and press Enter.
Select "Git Bash" from the drop-down list.

Add SSH keys to IBM i

Press Ctrl+` to open the terminal inside Visual Studio Code (displays at the bottom of the screen).

The ` should be the key above the Tab key

Enter the following command to change your current working directory to your home:
$ cd ~
Print your current working directory with this command:
$ pwd
This should print something like c/Users/YourWindowsUsername

Enter the following command to generate an SSH key:
$ ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa-ocean-ssh
Press Enter twice to leave the passphrase blank

ssh-keygen is the command to run (generate key) -t rsa specifies the type of key to create
-b 4096 specifies the number of bits in the key
-f ~/.ssh/id_rsa-ocean-ssh specifies the filename of the key

Enter the following command to copy your public key to the OC Skunks IBM i:
$ ssh-copy-id -i ~/.ssh/id_rsa-ocean-ssh %%IBM i Profile%%@OCSKUNKS.oceanusergroup.org
When prompted, enter your IBM i password.

ssh-copy-id is the command to run (copy id)
-i ~/.ssh/id_rsa-ocean-ssh specifies the identity file
[email protected] is the remote server

Test the SSH connection

Enter the following command to create an SSH connection to the OC Skunks IBM i:
$ ssh %%IBM i User%%@OCSKUNKS.oceanusergroup.org -i ~/.ssh/id_rsa-ocean-ssh
You should see a "bash-4.4$" prompt.
$ exit will disconnect the connection.

Download the SSH FS extension

Press Ctrl+Shift+X to open the Extensions pane (or click the icon in left-hand menu).
Type "SSH FS" in the search box.
Press Install for SSH FS extension.

Press F1 to open the command prompt.
Type "SSH FS: create a SSH FS configuration" and select the link from the drop-down list.
Enter the following configuration:

  • Name = "ocean_skunks_ssh_fs"
  • Location = "Global settings.json"
    Press Save button

On the next screen enter the following configuration:

  • Label = "OCEAN Skunks /home"
  • Group = "OCEAN"
  • Host = "OCSKUNKS.oceanusergroup.org"
  • Root = "/home/%%IBM i Profile%%"
  • Username = "%%IBM i Profile%%"
  • Private key = "c:\Users%%Windows Username%%.ssh\id_rsa-ocean-ssh"
    Press Save button

Press Ctrl+Shift+E to open the Explorer pane.
Open the SSH FILE SYSTEMS group at the bottom.
Right-Click on the "OCEAN Skunks /home" connection.
Select "Connect as Workspace folder".