Gcloud compute SSH connects to a different Instance than SSH + certificate - ssh

So I'm trying to connect to a gcloud instance where I've installed several packages and started to develop my code with no problem. During the week, I use a certificate and putty to login since I work with a windows machine.
However now that I'm home, I tried to connect to the instance using my mac where I installed the Google Cloud SDK and after configuring all the parameters using
gcloud init
I get logged to an empty instance that doesn't have all of the packages and scripts I mentioned above.
What am I doing wrong? I can confirm that I'm connecting to an instance with the same name, in the same region and all, but it is completely different.
Cheers!

As you are connecting from a different machine, that's a different user.
Go to /home, and check if there is a folder with the "other" username. Note that you might not be able to access. You would need to become superuser.

Related

Does replit uses ssh?

Replit's terminal provides a lot of features that are very similar to any Linux terminal. At first, I thought the site was using SSH to link a remote terminal to the website but when I ran the following command service ssh status, then the output was
* sshd is not running. This indicates that the site is not using SSH to link the terminal.
Does this mean the developers have created a custom terminal for their website or is there a way to show this output for remote users for security purposes?

how can I connect to the display on a google cloud machine?

I have succesfully created a machine on Google Cloud which I can access via
gcloud compute ssh my-service
however passing -X to ssh is not an option and I would like to see some plots.
Not sure what you mean with:
however passing -X to ssh is not an option and I would like to see some plots.
But you can also use the google console to connect to the SSH and get system usage graphs like CPU, Memory, Disk and Network usage.
Linux instances on GCP are server versions of the OS. There is no desktop. You can try using a VNC viewer like TigerVNC to get a similar desktop interface. You can also RDP to a windows instance to get a windows desktop. Your question is unclear. You will need to be more specific as to what you mean by "plots", "connect to the display", "-X" these terms are all very general and specific to your personal environment wherever you were.

Ohai: unable to get network attributes via ssh

I have several servers running centOS 6 and centOS 7. I am working in an inventory system, and for that I am using ohai, which is installed in all the machines.
When I do ssh myuser#myserver.com ohai it returns a json object with all the information but the network section empty.
However, if I ssh into the server and I run ohai I get the proper network attributes.
Someone has any idea what can be happening? Thanks!
I solved, the problem was that ohai needs root rights to check the nics properties.

Creating L2TP VPN on Mac OS X Programatically

I am trying to make application which can be use to connect to VPN using L2TP Protocol for Mac OSX Application using Objective C.
I search a lot regarding this but couldn't find any proper example or tutorial.
I Found halo/macosvpn for mac os vpn connection but it is command line tool i would like to make it in my application.
For E.g If i pass Server id, Shared Secret Key, username, password then my mac should be automatically connect to that VPN Server.
Any help will be appreciated...
No, you need use SCNetwork and Helper Tool (to get root access) With this link you will be able to create L2TP Protocol and connect with it.
This works even on the latest version MacOS 11 "Big Sure"
The helper tool is needed to get root access so you can make changes to the system keychain. You will put the password and shared secret there, because the configuration will not be able to perceive them from other places. Having created a vpn configuration with the help of SCNetwork, the mac will not be able to automatically connect.
To connect to the created profile, you need to programmatically execute the terminal command
networksetup -connectpppoeservice "name VPN profile"

Debian wheezy Linux guest environment not available

Since yesterday I can't connect through ssh to all of my Debian wheezy instances on my google cloud. I can connect only through the web console. When the web console tries to negotiate the session, there's a message telling me to update the Linux guest environment. But for wheezy, there is no Linux guest environment package.
Do you have any idea to resolve this issue ?
Debian 7 images were deprecated a while a go and as there are no update packages for the Guest Environment, the best approach would be to migrate to Debian 8 or 9.
To access your VMs you might try one of the following options:
1) According to this public issue the old guest environment still work with deprecated keys. If you have an SSH client configured with an old private key, you might still have access to your VMs through it.
2) Accessing the VM via the serial console
3) Mounting, as secondary, the original disk or a copy of it in a VM you do have access to. The steps are very similar to the section “Inspect an instance without shutting it down” on this document". That would allow you to recover your data.