Connecting to the drone with VSCode

  1. Install VSCode onto your computer (not the drone), here

  2. Open a terminal window on your computer and run:

cd ~/.ssh
ls
  • If you do not see id_rsa and id_rsa.pub, enter this command:

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Do not enter a filepath, username, or password, just press ``return`` when asked for those fields

  • Enter cat id_rsa.pub and copy the whole ssh key that is printed to your terminal

  1. Open a terminal window that is SSH’d into your drone:

    cd ~/.ssh
    ls
    vim authorized_keys
    
    • Navigate the bottom of the file, press i to enter insert mode, and paste your id_rsa.pub key. Then save and quit (press esc, then :wq)

  2. In your computer’s terminal (in the ~/.ssh folder) type:

vim config

Add the following block (4 spaces, not tabs):

Host <teamname>
    User uav
    HostName <teamname>.beaver.works
    ForwardX11 yes
    IdentityFile ~/.ssh/id_rsa
  1. Try SSH’ing into the drone in a new terminal. You should be able to use simply ssh <teamname>. You also should not have to enter the drone password anymore

  2. If this works, go to VSCode:

    • Click the square icon in the sidebar under the debug icon

    • Search for SSH and install the “Remote-SSH” plugin made by Microsoft

    • Select the monitor icon that appears in the sidebar, then click the window icon that appears when you hovor over your teamname option under Connections