Vagrant ssh prompts 'no kex alg' and I'm unable to connect to the virtual machine - node.js

I'm trying to connect to a vagrant with a command vagrant ssh as instructed in the official vagrant documentation. Earlier I used older ubuntu as a virtual machine: config.vm.box = "hashicorp/precise32". During that time, issuing a command vagrant ssh did let me connect to the machine with just a username and password.
Now I changed the vagrant box to a newer one because I wanted newer nodejs. Currently, the box is: config.vm.box = "ubuntu/vivid32". Now with this box, if I run the vagrant, and try to connect to the machine with vagrant ssh, it does not let me, but instead it will prompt no kex alg. I read somewhere it has to do with authentication using keys. How could I connect to the new ubuntu with vagrant ssh? One option could be to just regularly connect to the box.

I just had this same issue for a couple days a finally found a way to fix this. I know its a old topic but just incase other people will experiance the same issue. this is how you can solve it:
edit your sshd_config and add:
KexAlgorithms diffie-hellman-group1-sha1
this is what fixed it for me (obviously restart ssh after that)

I guess something was done wrong in the box - when you look the history https://vagrantcloud.com/ubuntu/boxes/vivid32 there has been a few boxes released in short time. I just downloaded the box today and it is working as expected.
I suggest you update the box and you will get the latest version
vagrant box update --box ubuntu/vivid32
Checking for updates to 'ubuntu/vivid32'
Box 'ubuntu/vivid32' (v20151001.0.0) is the latest version

you should go to your vagrant using putty or anything
after that
sudo nano /etc/ssh/sshd_config
go to bottom line and put
KexAlgorithms diffie-hellman-group1-sha1
after that ctrl+o and enter and ctrl+x
go back to your windows and reload vagrant
then try
ssh vagrant#127.0.0.1 -p 2222
Hope this help you

Related

Terminal Text overlapping after SSH connecting in Ubuntu

I got a problem that the text in the terminal was always overlapping when I connected to Windows Server using SSH, How can I fix it?
Annother question, Would this issue affect expect or pexpect(python) ?
I tried the two ways to connect windows via SSH in Ubuntu 20.04, both are the same situation that I can't run normally.
Snapshot:
Here is run script by expect
NETWORK file was not created.

Vagrant ssh doesn't display command prompt

I have a computer that runs Windows 8.1 and for some projects I use Vagrnat and VirtualBox, however after upgrading VirtualBox and Vagrant, after running Vagrant ssh, vagrant doesn't display the command prompt. I thought that may be it's a problem related with old boxes so I've create a new VM but the results is the same.
As can be seen below, some commands return results and everything is fine:
sudo -i returns me that stdin: is not a tty:
Could you have a look please and give me an idea about how can I solve this problem?

XQuartz error on ssh connection

I'm connected to a remote Linux server via ssh, and I'm trying to execute ImageMagick's display command. I know that the problem is probably not on the server side, because when I connect from different machines I don't get the same problem. And I installed XQuartz on my local machine as well as connected using the ssh tags -Y and -X (neither fix the problem) and I'm still getting the following error. My computer is a MacBook Pro running El Capitan. Any idea?
display: unable to open X server `' # error/display.c/DisplayImageCommand/426.
Thanks!
I think the trick is to start XQuartz in the background on your Mac before you do anything and allow remote machines to connect.
So, on your Mac, in Terminal, start XQuartz:
X &
Now right-click the XQuartz icon in your Dock and click:
Applications -> Terminal
and in the Terminal that appears, type:
xhost +
Later, when you have it working, tighten up the security on the xhost command by being a bit more specific with IP addresses.

Cannot display xclock program on xserver client - Mobaxterm

I am using Mobaxterm(free version) on a windows 7 desktop to connect to a SUSE 11 Enterprise server on AWS. I am trying to display the xclock program on my xtrem client but I get an error saying 'Error: Can't open display:'. I have used the following syntax to set the display on the server:
export DISPLAY=<IP_addr>:0.0
SUSE 11 does not come with xclock by default so I had to download it and install it.
The hosts file on my PC has the localhost entry commented out, I am not sure if that would make a difference. Any ideas on how to debug this? Thanks.
Fixed!
Earlier I was just looking at xclock program's error msg. But when I scanned Mobaxterms client terminal's output, I found the following msg:
X11 forwarding request failed on channel 0
After some google hunting, found that one of the reasons this happens is when xauth package is not installed on the remote server. So, I checked and found that to be the case. This is the command I ran:
zypper in -name xorg*
This command tells you if the package is installed and if any dependencies exist. The package comes bundled with the xclock program. So zypper uninstalled the other xclock I had installed from another source and replaced it with the right version.
Link to package info:
https://www.suse.com/LinuxPackages/packageRouter.jsp?product=server&version=11&service_pack=&architecture=i386&package_name=xorg-x11-xauth
I also modified a file called /etc/ssh/sshd_config as root. The following lines need to be uncommented:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
And X11UseLocalhost was changed to 'no'. I also changed my security group on AWS to let inbound traffic on port 6000. I am not sure if that matters.
After this mobaxterm automatically set my display parameter to localhost and I was able to run xclock on the remote server and see it on my local PC desktop.

SSH tunnelling into arch box

I have a raspberry pi running arch linux connected to the TV and want to run commands on that screen by SSH'ing from my Ubuntu machine elsewhere.
I have tried running the command SSH -Y root# and starting xclock as a test. However I get the following error:
No protocol specified
Error: Can't open display: :0
I then tried running "export DISPLAY=:0" on the arch machine, but this doesn't solve the issue.
I have X running fine and can see it on the TV and I have edited the file /etc/ssh/ssh_config to allow X11 forwarding.
Anyone know what I am doing wrong?
Many thanks
The ArchLinux wiki has some good instructions on setting things up. I struggled for a while until I found them, but for me the key was to set up SSH forwarding within sshd_config (most distros seem to enable this by default, but Arch doesn't).
Once you've enabled X forwarding in SSHD, I also found it helpful to install the dummy video driver for Xorg ("pacman -S xf86-video-dummy"), which gets rid of irritating errors about missing the RANDR extension. This might not be necessary if you already have it running a real X server locally on the Pi - personally, I'm running mine completely headless.
I've found that I don't have to worry about setting up the DISPLAY variable, or xhost, when running with 'ssh -X' from an iMac. I'd expect Ubuntu to behave the same.
looks like an authentication problem. The answer used to be
xhost +
on the console of the X display. Might help.
You probably want to set
export DISPLAY=[IP_ADDRESS_OF_ARCH_BOX]:0
on your Ubuntu box, then when you run xclock from your Ubuntu box, it'll forward the screen to the Arch box.

Resources