SSH into GCE from outside Plexguide | PlexGuide.com

SSH into GCE from outside Plexguide

  • Stop using Chrome! Download the Brave Browser via >>> [Brave.com]
    It's a forked version of Chrome with native ad-blockers and Google's spyware stripped out! Download for Mac, Windows, Android, and Linux!
Welcome to the PlexGuide.com
Serving the Community since 2016!
Register Now

rcarteraz

Veteran
Original poster
Donor
Nov 14, 2018
164
42
Hello, not sure where to post this and I apologize if this is something that should be self-explanatory but I cannot seem to figure it out. I can only SSH into it via the local box I have running Plexguide. I have to ssh into that one, sudo plexguide and follow the prompts to access the GCE instance. I'm trying to directly SSH into my GCE feeder instance using my laptop which is running Ubuntu. It won't connect and said "Denied (public key)." The reason I'm trying to directly SSH is the local box I am running plexguide on was just for testing purposes and it is being re-purposed since I grabbed a new hetzner server today. I don't want to repupose it though without a way to access my GCE instance. I can't even SSH on Google's cloud console. It does nothing. Is there something that locks it to the local machine since I used it to setup the GCE w/ the automated process?

Just so everyone is clear I'm using this command to try and ssh into it. "ssh [email protected]" and it denies it.
 
  • Like
Reactions: 1 user

Admin9705

Administrator
Project Manager
Donor
Jan 17, 2018
5,156
2,117
you have to check google's documentation. ssh is closed off, so you'll have to figure out from within the instance, how to open it up :D i just left as is for security reasons (because it works out of the box like that)
 

rcarteraz

Veteran
Original poster
Donor
Nov 14, 2018
164
42
you have to check google's documentation. ssh is closed off, so you'll have to figure out from within the instance, how to open it up :D i just left as is for security reasons (because it works out of the box like that)
I've tried to make heads or tails of that but cannot figure it out. I don't get how I can access it through the plexguide menus but nothing else.
 

Murphy

Citizen
Oct 19, 2018
14
8
para iniciar desde otro lado a VPS GCE
entra a http://console.cloud.google.com/
busca el proyecto de la maquina
selecciona o entra a la maquina para que te muestre los detalles
selecciona edit en el VPS
agrega una llave (ssh-key) a la configuracion de la MV GCE
yo tarde un dia pero encontre el metodo para conectarme a mi VPS GCE
(actualmente uso varios vps gce para experimentar con distintos script o auto instaladores, como plexguide, PlexGuide, dockstarter etc )
 
  • Like
Reactions: 1 user

rcarteraz

Veteran
Original poster
Donor
Nov 14, 2018
164
42
you have to check google's documentation. ssh is closed off, so you'll have to figure out from within the instance, how to open it up :D i just left as is for security reasons (because it works out of the box like that)
Can I back up the apps and restore them on my new server so I don't have to configure everything again? If so, then I can just destroy this GCE instance and deploy a new one on my new server.
 
  • Like
Reactions: 1 user

Admin9705

Administrator
Project Manager
Donor
Jan 17, 2018
5,156
2,117
Can I back up the apps and restore them on my new server so I don't have to configure everything again? If so, then I can just destroy this GCE instance and deploy a new one on my new server.
Yes u can always back up and restore

---- Automatically Merged Double Post ----

para iniciar desde otro lado a VPS GCE
entra a http://console.cloud.google.com/
busca el proyecto de la maquina
selecciona o entra a la maquina para que te muestre los detalles
selecciona edit en el VPS
agrega una llave (ssh-key) a la configuracion de la MV GCE
yo tarde un dia pero encontre el metodo para conectarme a mi VPS GCE
(actualmente uso varios vps gce para experimentar con distintos script o auto instaladores, como plexguide, Cloud, dockstarter etc )
Luv u bro always helping... Though can never read. Thank goodness for Google translate.
 
Last edited:
  • Like
Reactions: 1 user

Murphy

Citizen
Oct 19, 2018
14
8
mini tutorial para instalar ssh-key public en Google CE
Mini tutorial to install ssh-key public in Google CE
como sabrán no soy tan bueno en el ingles así que use google traductor XD
si no saben crear una ssh-key digan y les explico como crearla en windows o linux
//*As you know, I'm not that good in English, so I use the Google XD translator.

If you do not know how to create an ssh key, I'll give you a tutorial on how to create it in Windows or Linux.

open https://console.cloud.google.com/compute/instances
selecciona el proyecto
select the project

selecciona el projecto.png
2.- entrar a la maquina virtual click en el nombre
2.- enter the virtual machine click on the name
entra a maquina virtual.png

3.- Seleccione Editar
3.- select edit
seleccione edit.png

4.- Dirigete asta la parte de abajo y en clave SSH selecciona mostrar y editar
4.- Go to the end and in SSH key select show and edit.
selecciona mostrar y editar ssh.png
5.- seleccione editar un elemento
5.- select edit an element

añadir elemento sshkey.png

6.- Pegar tu ssh-key public anteriormente creada
6.- Paste your previously created public ssh key.
pegar ssh-key y guardar.png
 
  • Like
Reactions: 1 users

Admin9705

Administrator
Project Manager
Donor
Jan 17, 2018
5,156
2,117
mini tutorial para instalar ssh-key public en Google CE
Mini tutorial to install ssh-key public in Google CE
como sabrán no soy tan bueno en el ingles así que use google traductor XD
si no saben crear una ssh-key digan y les explico como crearla en windows o linux
//*As you know, I'm not that good in English, so I use the Google XD translator.

If you do not know how to create an ssh key, I'll give you a tutorial on how to create it in Windows or Linux.

open https://console.cloud.google.com/compute/instances
selecciona el proyecto
select the project

View attachment 2258
2.- entrar a la maquina virtual click en el nombre
2.- enter the virtual machine click on the name
View attachment 2259

3.- Seleccione Editar
3.- select edit
View attachment 2260

4.- Dirigete asta la parte de abajo y en clave SSH selecciona mostrar y editar
4.- Go to the end and in SSH key select show and edit.
View attachment 2261
5.- seleccione editar un elemento
5.- select edit an element

View attachment 2262

6.- Pegar tu ssh-key public anteriormente creada
6.- Paste your previously created public ssh key.
View attachment 2263
Awesome will add to wiki on rewrite
 
  • Like
Reactions: 1 user

rcarteraz

Veteran
Original poster
Donor
Nov 14, 2018
164
42
mini tutorial para instalar ssh-key public en Google CE
Mini tutorial to install ssh-key public in Google CE
como sabrán no soy tan bueno en el ingles así que use google traductor XD
si no saben crear una ssh-key digan y les explico como crearla en windows o linux
//*As you know, I'm not that good in English, so I use the Google XD translator.

If you do not know how to create an ssh key, I'll give you a tutorial on how to create it in Windows or Linux.

open https://console.cloud.google.com/compute/instances
selecciona el proyecto
select the project
2.- entrar a la maquina virtual click en el nombre
2.- enter the virtual machine click on the name
3.- Seleccione Editar
3.- select edit
4.- Dirigete asta la parte de abajo y en clave SSH selecciona mostrar y editar
4.- Go to the end and in SSH key select show and edit.
5.- seleccione editar un elemento
5.- select edit an element
6.- Pegar tu ssh-key public anteriormente creada
6.- Paste your previously created public ssh key.
Oh nice. Thanks for the information. I'll have to try and set that up. I actually lost the ability to connect via plexguide because I had to reinstall and I didn't want to go through the process of creating another instance. I also learned that if you click metadata in the menu on the left side and then edit and add a new item, for KEY you put enable-oslogin and VALUE you put true. That will allow you to press the ssh button on the overview page for your instance and connect using the browser.
 
  • Like
Reactions: 1 user

Murphy

Citizen
Oct 19, 2018
14
8
@Murphy So it's just "ssh-rsa [key][user]"? I tried this and still get connection refused "public key"
-The SSH key was installed on the machine created by you,
or the one that installs plexigide?

PlexGuide
It gives you the option to create a new project.
made sure to select the project and the virtual machine that is configured in PlexGuide

these days I upload a trial video tutorial how to install the ssh key correctly
be patient
 
  • Like
Reactions: 1 users

Murphy

Citizen
Oct 19, 2018
14
8
1.- create ssh-key from linux
sudo ssh-keygen -t rsa -b 4096 -C (userVM) -f /home/(userLocal)/.ssh/ssh-key_name
The configuration that worked for me through Linux.

-b ---> is optional

userVM ---> your virtual machine user (can be root or another google creates the user if it does not exist) (that's what I think XD)

userLocal -> user who are using or where the created key will be stored

ssh-key_name -> the name they want

2.-we change the permissions
sudo chown userLocal:userLocal ssh-key_name
sudo chown userLocal:userLocal ssh-key_name.pub
sudo chmod 400 ~/.ssh/ssh-key_name
sudo chmod 400 ~/.ssh/ssh-key_name.pub

3.-we connect to the virtual machine
ssh -i ~/.ssh/ssh-key_name [email protected]

more information:
https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys

When you have free time
I'm going to create the tutorial videos.
I wait for you and the information serves you
 
Last edited:
  • Like
Reactions: 1 users

macfreaker

Veteran
Jul 16, 2018
152
60
1.- create ssh-key from linux
sudo ssh-keygen -t rsa -b 4096 -C (userVM) -f /home/(userLocal)/.ssh/ssh-key_name
The configuration that worked for me through Linux.

-b ---> is optional

userVM ---> your virtual machine user (can be root or another google creates the user if it does not exist) (that's what I think XD)

userLocal -> user who are using or where the created key will be stored

ssh-key_name -> the name they want

2.-we change the permissions
sudo chown userLocal:userLocal ssh-key_name
sudo chown userLocal:userLocal ssh-key_name.pub
sudo chmod 400 ~/.ssh/ssh-key_name
sudo chmod 400 ~/.ssh/ssh-key_name.pub

3.-we connect to the virtual machine
ssh -i ~/.ssh/ssh-key_name [email protected]

more information:
https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys

When you have free time
I'm going to create the tutorial videos.
I wait for you and the information serves you
I like that you've put a howto, but for me this is not working. I am not on linux but on Mac Osx. What I try get always the same error.
 

Porkie

Experienced+
Staff
Aug 9, 2018
142
68
Its easier just to install google cloud sdk. Then you can use the ssh google command from the ssh options and paste it into the google cloud console. This will download the key you need and will auto open putty. To add it as a saved session your host will be whatever the user/machine name is when you log in and IP of the machine like [email protected] for example then just go to the auth section in putty and link the new key google cloud just downloaded. Its normally in C:/Users/username/.ssh you will have to show hidden folders to see it. Once that is all done enjoy sshing into your machine.
 
Last edited:
  • Like
Reactions: 1 user

macfreaker

Veteran
Jul 16, 2018
152
60
Its easier just to install google cloud sdk. Then you can use the ssh google command from the ssh options and paste it into the google cloud console. This will download the key you need and will auto open putty. To add it a** a saved session your host will be whatever the user/machine name is when you log in and IP of the machine like [email protected] for example then just go to the auth section in putty and link the new key google could just downloaded. Its normally in C:/Users/username/.ssh you will have to show hidden folders to see it. Once that is all done enjoy sshing into your machine.
This works for me. I have first installed Google SDK. Then I used following command to connect to GCE:

Code:
gcloud compute --project "My projectname" ssh --zone "us-east1-b" "pg-gce"
First time it will create a ssh keyset and connects after that directly to your instance. After that with the same command you can connect to your instance. Remember to set the correct zone (I use us-east1-B).
You can also put the command in a bat file (windows) or sh file (linux or osx) to easy start the console.
 

Porkie

Experienced+
Staff
Aug 9, 2018
142
68
Once you have the key on your system though you can just use putty and it will auto login.



Then link the key in same session like.



Then putty will just ssh straight in no password needed.

I didnt explain good enough probably but this is the way I do it and it seems easier for me.
 
  • Like
Reactions: 1 user

macfreaker

Veteran
Jul 16, 2018
152
60
Once you have the key on your system though you can just use putty and it will auto login.



Then link the key in same session like.



Then putty will just ssh straight in no password needed.

I didnt explain good enough probably but this is the way I do it and it seems easier for me.
I am using Mac Osx and using terminal to connect that's why I use the command like I mentioned before.
Thanks for the tip and I am sure that for a lot of users this will be the solution for connecting to their GCE.
 

Recommend NewsGroups

      Up To a 58% Discount!

Trending