Cannot SSH to Azure VM: no kex alg - ssh

I have followed this tutorial (https://code.visualstudio.com/docs/remote/ssh-tutorial), but get the error "no kex alg", when I try to connect. Have tried to do the fixes suggested in
Vagrant ssh prompts 'no kex alg' and I'm unable to connect to the virtual machine
Any suggestions? Please see error log below.
Error log

OPEN THE PORT 22 in your Vm
so to this you have to go to your VM in AZURE and then networking and you will find all of the ports
so what you have to do it just open the ssh port 22
enter image description here
this link it will be very useful to you because it's explaining how to open the port 22 from AZURE
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/nsg-quickstart-portal
and for manage ssh public key with vm you can check this link
https://learn.microsoft.com/en-us/cli/azure/sshkey?view=azure-cli-latest

Related

issue with ssh-copy-id rootname#ipaddress

I am getting repeated errors whenever i am executing ssh-copy-id root#ip.
/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/aasthajainsimpl/.ssh/id_rsa.pub"
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: ERROR: ssh: connect to host 13.89.203.233 port 22: Connection timed out
enter image description here
Looks like the 13.89.203.233 host doesn't have ssh server on port 22 (or this port is behind of firewall). Try to see into sshd.conf or firewall config.
Also maybe the IP address is wrong - it belongs to Microsoft.

Can't connect to port 22, Connection timed out

I just recently got into whatever you might call this stuff. I was just trying to send a java file over to the computer I ssh to. But when I went to do it, I just get told
sh: connect to host port 22: Connection timed out
lost connection
If possible I would like it explained very simply because of how new I am to this kind of stuff.
SSH to remote host(VM Ubuntu) from VS code terminal
Install VS Code with Remote Development extension pack.
Install Virtual machine (Virtual box) and Ubuntu running on it.
Check Ubuntu-Network-Settings-IPv4 address (10.0.2.15-default for VM).
Go to your virtual box Settings-Network-NAT Adapter (double-check).
Go to your virtual box Settings-Network-In Advanced-Port Forwarding.
Add this as given below and click ok and hereafter consider 127.0.1.1 for ssh.
portforwardinginVM
View the status and disable firewall settings in Ubuntu VM (ufw command).
In VS Code, View-Command Palette- Add new SSH host .
Add ssh username#127.0.1.1 and enter.
Or go to the terminal window (eg. Powershell) and type ssh username#127.0.1.1, it will ask if you want to update to host lists permanently, asking like yes/no and also your Ubuntu password to confirm.
Now try to connect to the host using username#127.0.1.1 and selecting OS like Ubuntu, then type the Ubuntu password.
That's it you are logged in to your virtual machine and can access files now from your local machine.

Unable to SSH into vmware esxi 6.7 host

I want to ssh into vmware esxi 6.7 version but gets permissino denied error.
I have
1- enabled ssh on esxi 6.7 by starting TSM-SSH into host mode
2- created ssh key on remote vm
3- i can ping esxi 6.7 server
4- esxi port also working
5- in ssh config remote permission set= yes and public key authentication = yes
but still unable to ssh
i am using correct authentications. help me with this as i am new to vmware and don't know other ways
It is solved by making changes in configuration file of .ssh and checking if any firewall is active.
After this we just need to restart our ssh service.
With correct username#ip connect to our server.
This is working for me.

Problems connecting one GCE instance to another via SSH

I am attempting to connect (via SSH) one GCE VM instance to another GCE VM instance (which will be referred to as Machine 1 and Machine 2 from now one).
So far I have generated (via ssh-keygen -t rsa -f ~/.ssh/ssh_key) a public and private key on Machine 1, and have added the contents of ssh_key.pub to the ~/.ssh/authorized_keys file on Machine 2.
However, whenever I try to connect them via ssh using the following command: gcloud compute ssh --project [PROJECT_ID] --zone [ZONE] [Machine_2_Name] it simply times out (Connection timed out. ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].)
I have doubled checked that each VM instance has plenty of disk space, and their firewall settings are permissive, and OS Login is not enabled. I have read through the answer here but nothing is working.
What am I doing wrong? How do I properly SSH from one GCE VM instance to another?
The problem I was having was that each VM was using a different network/sub-network with different firewall configurations. After making one using the same network/sub-network, I was able to easily ssh into one from the other via
username#machine1:~$ ssh machine2
I tested the same scenario on my side and I got the same result as you said. Then I ran this command inside the machine to debug the SSH process to try to narrow down the issue:
gcloud compute ssh YOUR_INSTANCE_NAME --zone ZONE --ssh-flag="-vvv"
Then I got this result:
debug1: connect to address 35.x.x.x port 22: Connection timed out
ssh: connect to host 35.x.x.x port 22: Connection timed out
So, means the instance 1 is unable to connect to the external IP address of instance 2. I only added a new firewall rule and it works.
After running above mentioned command, if you see any permission denied message, it means you did not copy the public key to the source machine properly.

cygwin connection refused for port 22

I have installed cygwin in windows 7 but i get the following error
$ ssh localhost
ssh: connect to host localhost port 22: Connection refused
I faced the same problem but I ran this on the CYGWIN command line and it worked :
~ : net start sshd
After that I executed the command ssh -v localhost and the error message didn't show up. Hope that this helps !.
If you are facing this problem in Windows XP follow these steps to open port for ssh:
Go to windows firewall of security section in control panel
Exceptions->add port
Give port name as ssh and number as 22.
Select option TCP
Click on Ok
This will help you open ssh from cygwin
For local application development like hadoop on windows please change the scope localhost /ip address in the custom list.
You can try to use port 23 or ask your host provider for the ssh port. Some host providers change the ssh port.
ssh user#yoursite.com -p 23
Cygwin doesn't install an SSH server by default, although you can set up sshd if you want. By default, however, there's nothing to ssh to.
Follow the steps in this link and then do a
$~ net start sshd
$~ ssh localhost