SSH into Remote VM with VS Code | Tunneling into any cloud | GCP Demo

Ғылым және технология

Are you wondering how to open a remote folder in VS Code via SSH?
That's exactly what we show you in this video. With this approach you can use Visual Studio Code on your local machine but store and run your source code on a remote machine on literally any cloud. In this live demo we are creating a virtual machine on the Google Cloud Platform (GCP) and SSH into it.
Chapters in this video:
0:00 - Intro and Explanation
01:09 - Create Virtual Machine (GCP)
02:53 - Remote SSH config in VS Code
05:19 - Private/Public Key creation (ssh-keygen)
07:19 - Add Public Key to GCP VM
08:06 - Connect to Remote VM
09:45 - Verify SSH Server is running
10:08 - Install SSH Server (optional)
18:18 - Outro
Contact us:
www.blueantoinette.com/contac...
/ blueantoinette_
Note the underscore in our Twitter Handle: @BlueAntoinette_
Blue Antoinette:
www.blueantoinette.com/
Hashtags:
#ssh #vscode #gcp

Пікірлер: 72

  • @BlueAntoinette
    @BlueAntoinette11 ай бұрын

    Note: If you use VMs with ephemeral IP addresses your host keys in the file ~/.ssh/known_hosts may become invalid on VM restarts. In this case you can delete the line with your VMs IP address from the ~/.ssh/known_hosts file and then connect to your VM.

  • @KarenP21

    @KarenP21

    10 ай бұрын

    Thanks

  • @PLATONU

    @PLATONU

    10 ай бұрын

    thank you very much! I can add something... you will get some errors if you choose google IAM and want to use SSH with thirds software... you must to choose carefully, cant get both google cloud IAM conections and private SSH

  • @silviomazzucco8891

    @silviomazzucco8891

    3 ай бұрын

    The HostName in the ssh config file also needs to be changed to the new one

  • @dravitch
    @dravitch3 ай бұрын

    Thanks man. I was about the become crazy trying to figure out the Google Cloud documentation. Your tuto is simple and crystal clear.

  • @BlueAntoinette

    @BlueAntoinette

    3 ай бұрын

    Great to hear!

  • @silviaregina9608
    @silviaregina96084 ай бұрын

    Guys, I tried N tutorials, even one where the SDK itself created the .config and only this one worked. Thank you man, you are incredible.

  • @BlueAntoinette

    @BlueAntoinette

    4 ай бұрын

    Glad to hear that

  • @valeras9416
    @valeras94167 күн бұрын

    Best video ever uploaded to youtube, thanks man.

  • @BlueAntoinette

    @BlueAntoinette

    7 күн бұрын

    Glad you liked it!

  • @markphilipsy5222
    @markphilipsy52227 ай бұрын

    Thank you. This helped me setup my VS Code to my GCP instance :)

  • @BlueAntoinette

    @BlueAntoinette

    7 ай бұрын

    Great to hear!

  • @Jojo-lf4cw
    @Jojo-lf4cw25 күн бұрын

    Thank you! This is a great tutorial!! Super clear and well-organized!

  • @BlueAntoinette

    @BlueAntoinette

    25 күн бұрын

    Glad it was helpful!

  • @bcak611
    @bcak61111 ай бұрын

    Thank you, it worked! I did copy the gcloud command but it didn't work, maybe some error with the ssh key. But I manually created the key and added it into the VM instance and It worked instantly. Thanks a lot!

  • @BlueAntoinette

    @BlueAntoinette

    9 ай бұрын

    Great, thanks for your feedback

  • @user-xl8pz6kj5h
    @user-xl8pz6kj5h6 ай бұрын

    Fabulous, i was missing the IdentityFile line. Thanks man kudos

  • @BlueAntoinette

    @BlueAntoinette

    6 ай бұрын

    Thanks a lot for your feedback!

  • @JardanySvidrigailov
    @JardanySvidrigailov2 ай бұрын

    Wow, this is a real tutorial, very specified, an actually works, thanks

  • @BlueAntoinette

    @BlueAntoinette

    2 ай бұрын

    Glad it helped

  • @ericritter46
    @ericritter464 ай бұрын

    I spent about a week trying to do this. My issue was specifically generating the SSH key and then adding the IdentityFile line. Thank you so much.

  • @BlueAntoinette

    @BlueAntoinette

    4 ай бұрын

    Glad it helped!

  • @tsykin
    @tsykin4 ай бұрын

    Worked for me! Thanks for this guide 👍

  • @BlueAntoinette

    @BlueAntoinette

    4 ай бұрын

    You're welcome!

  • @alexiojunior7867
    @alexiojunior786720 күн бұрын

    Thank you so much this worked for me after spending the whole night stuck on one place

  • @BlueAntoinette

    @BlueAntoinette

    20 күн бұрын

    Glad it helped

  • @user-hn8cx4mq1t
    @user-hn8cx4mq1t11 ай бұрын

    Perfect!!!! Thank you very much

  • @BlueAntoinette

    @BlueAntoinette

    9 ай бұрын

    You're welcome!

  • @user-bl4wn6cr2i
    @user-bl4wn6cr2i5 ай бұрын

    Thanks a lot! It worked :)

  • @BlueAntoinette

    @BlueAntoinette

    5 ай бұрын

    Great, thanks for the feedback

  • @jhoanmartinezsilva2609
    @jhoanmartinezsilva26094 ай бұрын

    Huge Thanks!

  • @BlueAntoinette

    @BlueAntoinette

    4 ай бұрын

    You're welcome!

  • @dariuszewski7557
    @dariuszewski75576 күн бұрын

    Thank you so much!

  • @BlueAntoinette

    @BlueAntoinette

    5 күн бұрын

    You're welcome!

  • @mahmoudsamyessawy
    @mahmoudsamyessawyАй бұрын

    Thank you very very very much , you rescued me

  • @BlueAntoinette

    @BlueAntoinette

    Ай бұрын

    Glad to hear that

  • @bridgingedges3219
    @bridgingedges32195 ай бұрын

    thank you for this video

  • @BlueAntoinette

    @BlueAntoinette

    5 ай бұрын

    You are welcome

  • @likeademonicmind1702
    @likeademonicmind1702Ай бұрын

    Thanks!!

  • @BlueAntoinette

    @BlueAntoinette

    Ай бұрын

    Welcome!

  • @RO-nb6mz
    @RO-nb6mz6 ай бұрын

    this helped alooot!

  • @BlueAntoinette

    @BlueAntoinette

    6 ай бұрын

    Great, thx!

  • @vincent3846
    @vincent38465 ай бұрын

    thanks man !

  • @BlueAntoinette

    @BlueAntoinette

    5 ай бұрын

    Happy to help

  • @user-pb7ef5cu8x
    @user-pb7ef5cu8x3 ай бұрын

    can i use more than 1 host like remote-ssh-demo1 and remote-ssh-demo2 with different ssh key ?

  • @BlueAntoinette

    @BlueAntoinette

    3 ай бұрын

    Yes, just add multiple sections in your config file with IdentityFile entries pointing to different private key files.

  • @bombdotcomist
    @bombdotcomist10 ай бұрын

    Awesome tutorial, but I still have an issue where I'm unable to write the files because I don't seem to have permissions... not sure how to fix ;(

  • @BlueAntoinette

    @BlueAntoinette

    9 ай бұрын

    Could you fix your issue? Feel free to provide more details of your error and your setup otherwise.

  • @hivaghanbari1113
    @hivaghanbari11134 ай бұрын

    Hello, I tried all the steps to connect to a VM in GCP via VS code on my mac book, but getting this error "Could not establish connection to "VM NAM": The operation timed out. Any help would be much appreciated.

  • @BlueAntoinette

    @BlueAntoinette

    4 ай бұрын

    Do you use ephemeral IP addresses? You can delete your VMs IP address from your local ~/.ssh/known_hosts file and try it again.

  • @shauryatiwari7462
    @shauryatiwari74624 ай бұрын

    Tried all the steps mentioned in the video, but still getting the error "could not establish conection to " and sometimes permission denied "publickey".

  • @BlueAntoinette

    @BlueAntoinette

    4 ай бұрын

    Do you use ephemeral IP addresses? You can delete your VMs IP address from your local ~/.ssh/known_hosts file and try it again.

  • @user-qc4nl9rd3z
    @user-qc4nl9rd3z3 ай бұрын

    After all manipulations, i get error "could not establish to "my ssh"" Detail: I use ssh on host of site

  • @BlueAntoinette

    @BlueAntoinette

    3 ай бұрын

    Please check my comments on comparable requests. If it doesn’t work in your case feel free to provide more details of the error you receive along with information about which cloud provider you use.

  • @chellosoccer
    @chellosoccer6 ай бұрын

    Can I do this with a local VM on my local server?

  • @BlueAntoinette

    @BlueAntoinette

    6 ай бұрын

    Yes, but you need to install the OpenSSH server and to enable PubkeyAuthentication in the /etc/ssh/sshd_config file. Then create the file ~/.ssh/authorized_keys and add your public key to it. Relevant commands e.g. on Debian 11: sudo apt install openssh-server sudo systemctl status ssh sudo systemctl start ssh sudo systemctl stop ssh

  • @1688tito
    @1688tito3 ай бұрын

    Crack

  • @BlueAntoinette

    @BlueAntoinette

    3 ай бұрын

    ?

  • @emmanuelpascal498
    @emmanuelpascal4984 ай бұрын

    Please how do you know the username I’m confused because isn’t working

  • @BlueAntoinette

    @BlueAntoinette

    4 ай бұрын

    The username by default is the first part of your email address (before the @) that you used to create the VM

  • @KarenP21
    @KarenP2111 ай бұрын

    I followed to same steps and yet the connection did not work... any idea why?

  • @BlueAntoinette

    @BlueAntoinette

    11 ай бұрын

    Which platform are you trying to connect to? Do you get any error messages?

  • @KarenP21

    @KarenP21

    10 ай бұрын

    @@BlueAntoinette a VM on GCP. The error was "permission denied (public key)". But the IP address is ephemeral so I will follow your advice for that case.

  • @PLATONU

    @PLATONU

    10 ай бұрын

    @@KarenP21 try to get a "static" external IP, before connect with VSC, because you will need to change IP in the config file

  • @m.kaschi2741

    @m.kaschi2741

    9 ай бұрын

    maybe that helps u @KarenP21 ssh-keygen -t rsa -f Path/to/.ssh/filename -C yourUserName -b 2048 For GCP its important that yourUserName matches you OS Username

  • @KarenP21

    @KarenP21

    9 ай бұрын

    it's working now :) I didnt have to use this line

  • @Willifordwav
    @Willifordwav4 ай бұрын

    This worked for about 5 minutes. Then all of a sudden I am getting a Timeout when I am trying to connect.

  • @BlueAntoinette

    @BlueAntoinette

    4 ай бұрын

    If it worked for 5 minutes it means that it works principally and your problem has a different cause. Maybe you restarted the VM and you received a new ephemeral IP address or your VM ran out of resources, … If you want individual consulting, feel free to check out my consulting offering at www.blueantoinette.com/product/consulting-analysis-hour/

Келесі