Search code examples
visual-studio-codesshvscode-remotevscode-remote-ssh

Unable to connect Lightning AI to local vs code via SSH


I'm unable to set up my lightning AI environment on local machine. I have performed all the steps upto the first image shown with this issue.

I have performed all the steps up to this one

As i click on "Connect local VS Code", it opens up my local VS Code, tries the connection

This error pops up

I've tried pinging lightning's ssh on local powershell terminal, ping works fine.


Solution

  • Have you generated a key pair and added the public key to the remote server? It will be used as your credential for authentication.

    If not, you can generate a 4096-bit RSA key pair by running ssh-keygen -t rsa -b 4096 -C "[email protected]" in cmd with your email address as a comment. Copy everything from your public key file C:\Users\<username>\.ssh\id_rsa.pub and paste it into the appropriate SSH settings on the remote server.

    Finally, specify the location of your private key file in your SSH configuration file, so the client process can send the correct response when the server challenges your identity. The config file is usually located at C:\Users\<username>\.ssh\config. Find the entry for Host ssh.lightning.ai and add IdentityFile ~/.ssh/id_rsa to it.

    After completing the above tasks, SSH should be working correctly. I apologize if it does not resolve your issue; we can discuss further if needed.