Not able to login after migrating libvert on-prem boot disk to Google cloud platform using cloud endure migration service - ssh

I migrated the vm from libvirt to Google Cloud Platform using Cloudendure. The initial sync is complete and is in Data Replication stage from over a week. Once the VM is launched using test mode and try to putty using ssh it throws Connection Refused exited with error code 255.
I tried to log in using my on-premise local machine username and SSH key with putty, As it is told in the Cloudendure documentation that I can log in to the replicated server using same credentials
The firewall rule in GCP and the machine allows port 22 for incoming connections. SSH key is also updated properly in metadata section and saying SSH key is not propagated properly.
I thought there is a problem with my local machine ufw rules and tried turning off firewall and replicated again but no use. Also tried adding SSH rule to ufw allow connections from 0.0.0.0/0 still I'm not able to connect to VM which is replicated and launched in test mode.
Steps tried:
I tried interactive console method where I tried to log in using serial-port, but the problem is it is asking for ID and password. Where I don't have PASSWORD and using only SSH keys to log-into.
Tried using Static IP for an instance. before replicating boot disk I added firewall rule allow SSH from that static-IP then I replicated and tried to login (assuming that it is blocking connection via this IP).
Followed this article to install Linux Guest OS.
Generated SSH key using ssh-keygen -t RSA -C "" in gcloud shell.
I cannot ssh into the Linux environment. Appreciate the help
Operating System: Ubuntu 18.04 LTS x64
ANy help would be greatful.

Related

SSH from Windows 10 to Windows 10 port 22 time out, and password issue

So I have been toying around with this for a week now and it is driving me bananas. I have the native Windows 10 SSH server and client installed on both machines. Most of the time when I try to connect I get "ssh: connect to host 10.0.0.8 port 22: Connection timed out" when I realized it might be my firewall I disabled it and tried again only to get "ssh: connect to host 10.0.0.8 port 22: Connection refused". The only time I have gotten closer is when using a Ubuntu VM, but then when I am prompted for a password none work, I assume that has to do with the rsa key that I have yet to establish.
How can I get either (Preferably Both) of these connections to work?
Can two Windows 10 PCs even SSH to each other?
Is there a solid tut out there that I should turn to?
I would be thankful for any help on this problem.
Thank you for your time
N/A
Yes, you can use the optional Windows 10 feature OpenSSH Server (sshd) and the corresponding ssh client to make connections between two Windows 10 PCs. You can actually use any ssh standard client to connect, i.e. ssh from Linux.
When you install the "OpenSSH SSH Server (sshd)" from the optional feature settings in Windows it will also automatically create a firewall rule in the Inbound Rules folder of the Windows Defender Firewall and activate the rule. This should make it possible to connect with any ssh client to your PC.
After the installation check the following:
The Windows Service called OpenSSH SSH Server is started and running, it is set to manual start as default so it will not be running unless you have started it.
The inbound firewall rule OpenSSH SSH Server (sshd) is enabled in Windows Defender Firewall with Advanced Security
If these are active you should be able to use ssh MACHINENAME from a shell, command prompt or terminal on another PC to connect to the PC running the SSH server.
When using a Microsoft Account the user name might display a shorter version of the username when you sign-in but the password would be the same as your Microsoft Account.
I just had a similar problem. In my case, I fixed it in the services settings on windows. Make sure that the startup options of the Open SSH Agent and Open SSH Server services are set to automatic and that you start the services. At best, do a reboot afterwards. Again check whether sshd and ssh-agent in the services tab in task manager are running. Then, it should work.

Connecting to a gcloud vm instance via ssh

Problem:
I cannot connect via ssh to my vm instance on gcloud
Description:
I am using gcloud with my own domain as the user userid#mydomain.com
I created a vm instance on Google Cloud Engine
I installed "WordPress Multisite Certified by Bitnami" via Cloud Launcher
The vm is up and running, I can even access a wordpress page.
In the section "VM Instances", I click the button SSH, but cannot connect, the window prompts:
Transferring SSH keys to the VM.
Could not connect, retrying (1/3)...
The log does not contain any errors.
Attempt 1: Gcloud API
In the Windows CMD, I can successfully connect by calling
gcloud compute ssh userid_mydomain_com#MY_INSTANCE_NAME
It generates file in C:\Users\ACCOUNT_NAME.ssh, but the file google_compute_engine.pub contains my Windows account name at the end in the format HOST\account_name#host, not my gcloud user name (userid#mydomain.com)!
I retried the ssh button, but it still failed.
I then pasted the content from the file google_compute_engine.pub into the ssh key field, but it still doesnt work, perhaps due to the wrong user name? I changed the name, but that didnt help.
Attempt 2: PuttyGen
I also tried generating ssh key with PuttyGen as described here and used userid#mydomain.com in the key comment. With or without the newly generated public key in the vm instance configuraton, I can not ssh into the vm.
Question:
How can I access my vm on gcloud via the ssh button and via putty?
Update:
I can connect to my vm instance using Putty and WinSCP.
I entered the keyfile provided in the Bitnami launchpad and the user name 'bitnami'. The ssh buttons, however, still dont make me enter.
You might not be using the right credentials. However, it's pretty weird the Web Browser Terminal Google offers
you through the SSH button doesn't work.
Please take a look to the documentation below and try to follow the steps, it might help you:
https://docs.bitnami.com/google/faq/#how-to-connect-to-the-server-through-ssh
You can connect to a VM instance via many ways:
SSH from Google cloud console
Connect via Cloud shell
Connect via your local terminal with gcloud command with IAP by using --tunnel-through-iap parameter.
gcloud compute ssh userid_mydomain_com#MY_INSTANCE_NAME --tunnel-through-iap

Start ipython cluster using ssh on windows machine

I have a problem setting up a ipython cluster on a Windows server and connecting to this ipcluster using a ssh connection. I tried following the tutorial on https://ipython.org/ipython/doc/dev/parallel/parallel_process.html#ssh, but I have problems to understand what the options mean exactly and what parameters are to use exactly...
Could anyone help a total noob to set up an ipcluster? (Let's say the remote machine has ip 192.168.0.1 and the local machine has 192.168.0.2)
If you scroll roughly to the middle of the page https://ipython.org/ipython-doc/dev/parallel/parallel_process.html#ssh you will find this:
Current limitations of the SSH mode of ipcluster are:
Untested and unsupported on Windows. Would require a working ssh on Windows. Also, we are using shell scripts to setup and execute
commands on remote hosts.
That means, there is no easy way to build an ipcluster with ssh connection on windows (if it works at all).
Do you really need to connect the machines with an ssh connection? I guess it's possible with a ssh client on each windows machine, but if you are in a trusted local network you can also decide not to use the loopback interface and just expose the ports...
Sure you can start controller and engine separately! For further examples about ports (if you have problems with firewalls) see also How to setup ssh tunnel for ipython cluster (ipcluster)

Google Cloud server (GCE), custom image, SSH login issue

I'm playing with Google Compute Engine(GCE) as I'm planning to migrate the cloud service provider from Rackspace(reason: GCE has good upgrade plans with best discount price).
I have few issues with GCE and one of them is Ubuntu os/image not supported by default. But there is an alternate method to run any linux distro in GCE, which is called Building an image from scratch for uploading custom images and creating instances(servers) from uploaded image.
I could able to create and run the instances from the Ubuntu image I uploaded to GCE following the link hagikuratakeshi.hatenablog.com. This is simply running ubuntu in general. I didn't face any problem but google's gcutil tool prompts for ssh passphrase and adds the key in GCE meta data but accepts only password logins(then why it prompts for passphrase).
I want to strictly follow Building an image from scratch as recommended by google. But after following all the steps, I could not able to login to my server instance via SSH. I guess this happens when I install Google Compute Engine image packages: google-startup-scripts_1.1.2-1_all.deb, google-compute-daemon_1.1.2-1_all.deb & python-gcimagebundle_1.1.2-1_all.deb. These packages/scripts make some changes to the instance at the startup and also to SSH configuration which are Strongly recommended. Once I strictly follow the link or once I install these packages I could not able to establish SSH connection once the instance is rebooted. The error message similar to the one below is shown while trying to connect:
test#machine1:~$ gcutil --service_version="v1" --project="mypro-555" ssh --zone="asia-east1-a" "server-instance-1"
INFO: Running command line: ssh o UserKnownHostsFile=/dev/null -o CheckHostIP=no -o StrictHostKeyChecking=no -i /home/test/.ssh/google_compute_engine -A -p 22 test#101.167.xxx.xxx -
ssh: connect to host 101.167.xxx.xxx port 22: Connection refused
NOTE: The user account test is available and common on both local and GCE server!.
My main problem is SSH connection when I strictly follow the steps. If I upload the fresh image and then follow the recommended steps connecting SSH, I could not do SSH again once I restart the instance (or) if I setup everything in the uploaded image before uploading, the created instance will be running but I could not able to connect atleast ones and the error is same.
Anybody using GCE with your custom image?, are you allowed to connected even after following the recommended settings?. Anyone already fixed this SSH issue?. Please post your comments!
EDIT 1
I could not figure out from the logs and here is the output of gcutil getserialportoutput server-instance-1.
The key here is that your ssh client says "connection refused". This indicates that there is indeed a machine at that IP address, but it's not accepting SSH connections. There are a few possible explanations:
The ssh daemon isn't running, or is listening on the wrong interface
Your instance is configured with a firewall that's denying SSH traffic
The GCE firewall rule to allow SSH traffic has been removed

Jenkins: Start of windows SSH slave times out

OK, I have a Jenkins Master on CentOS and I use it to run a bunch of windows slaves with installed java services and that runs flawless. Now I have a new windows server in DMZ so I cannot use the Java webstart. I have installed Cygwin SSH on the server and I can use SSH to connect to it with Putty, so that end seems to work.
In Jenkins I have installed SSH Plugin, SSH Slave plugin and SSH Credentials plugin.
Remote FS-root is: "C:\jenkins" (as I read somewhere)
Launch method is: "Launch slave agents on unix machines with SSH"
Host: dmz-address.domain
Credentials: Global cred with User password. (the credentials that works with putty)
I cannot see a log and in the node list there is just a message that there was a time out.
So even if I can reach the slave with SSH, Jenkins cannot and I suspect that I have missed something.