Having trouble in accessing my virtual machine from local with SSH - hadoop

I've ubuntu 16.04 on both my local and virtual machine, I want to access my virtual machine from my local machine, I've already changed the network adapter to bridge connection (both ips are in 192.168,10.x). But when i run the ssh virtual_mac_ip from my local terminal i get the error ssh: connect to host 192.168.10.7 port 22: Connection refused.
ps: I want to configure single node hadoop cluster

The issue has been resolved I changed my network adapter to NAT again, and use port forwarding on port 2222. Now when I run "ssh -p 2222 username#127.0.0.1", I am able to connect to my guest OS
Side note: Please check if OpenSSH is installed on your guess machine

Related

Virtualbox and host connection problem: unable to ping and ssh connection from host to VM, but VM to Host ping and ssh connections working

I have been searched many resources, but I can't solve this problem.
Firstly, I want to clarify that, my windows 10 all firewall options are turned off (also turned off ubuntu server 16.04)
Windows firewall settings
this is my host machine ip configuration (windows 10)
Host machine IP
this is my NatNetwork configuration in Virtualbox
NatNetwork configuration in Virtualbox
this is my port forwarding configuration in NatNetwork
Port Forwarding configuration
I want to mention that when I use 127.0.0.1 Ip address as a port forwarding HOST IP address. this is not working also, but I can ping from my host to 127.0.0.1 IP address.
this is my ubuntu_server 16.04 ip configuration
Ubuntu_server 16.04 IP configuration
When I ping from ubuntu_server to my HOST (from 172.31.0.4 to 192.168.0.110), I can ping
from VM to HOST ping
But I can't ping from HOST to VM (from 192.168.0.110 to 172.31.0.4), I get the request timed out.
enter image description here
So, I can't ping from HOST to VM, please help me solving this problem
I have a problem VM and HOST connection.

Setup ssh tunnel from docker container on macos Mojave 10.14

I am having trouble setting up an ssh tunnel on my mac machine. I have no problems setting up the tunnel on my ubuntu box. This is the command I run
ssh -nNT -L 172.18.0.1:4000:production-database-url:3306 jump-point
When I run this on my mac, I get the following error:
bind [172.18.0.1]:4000: Can't assign requested address
channel_setup_fwd_listener_tcpip: cannot listen to port: 4000 Could
not request local forwarding.
If I run without the bind_address (172.18.0.1), I am able to connect to the database via the tunnel.
If I bind to all interfaces (0.0.0.0), then tunnel is open, however, the connection to the database from inside the docker container does not work.
172.18.0.1 is the IP of docker's default bridge network gateway, not your host's IP.
You can run this command to check that.
$ docker network inspect bridge
Docker for Mac has limitations
There is no docker0 bridge on macOS (it's in the docker VM host on Mac and on Windows)
You cannot ping containers (without shaving a bunch of yaks)
Per-container IP addressing is not possible
Also note that this means the docker run option --net-host is not supported on Mac, but maybe that's a good thing
There is a workaround
These magic addresses resolve to the host's IP from within a container
docker.for.mac.localhost (deprecated)
docker.for.mac.host.internal (deprecated)
host.docker.internal
This resolves to the gateway of the host mac
gateway.docker.internal
Use the name host.docker.internal from within the container just like you would use localhost on the mac directly.
Don't worry about the bind address for the tunnel:
ssh -nNT -L 4000:production-database-url:3306 jump-point
You didn't mention which database but I take it from the port 3306 that it is MySQL.
To connect using the mysql cli from within a container, via an ssh tunnel on your host, to a remote mysql database server you can run:
mysql --host host.docker.internal [... other options go here]

Connection timed out while copying ssh key from CentOS to Ubuntu using ssh-copy-id

I'm trying to copy my public key from a CentOS environment to a Ubuntu machine. I used the following command
ssh-copy-id root#Ubuntu_IP
However I get an error saying Connection timed out. I'm able to ping from my host to the remote machine. The purpose behind this is that my host machine is ansible control node where as Ubuntu machine is my managed node.
Make sure you add a permanent route in the remote machine for the host machine.
route add -net remote_ip netmask mask_ip gw gateway_ip eth0
Also disable the firewall on the remote machine. This seemed to have solved the problem in my case.

cannot connect to host 127.0.0.1 Virtualbox

So I'm using a Macbook Pro with virtualbox and trying to SSH to CentOS virtual machine.
I've started the SSH service on centOS and I've gone into the network settings of virtualbox and made sure that the adaptor was set to NAT and that port forwarding was set to port 22 for the guest and host.
When I run the following on my mac: ssh 127.0.0.1
It says: ssh: connect to host 127.0.0.1 port 22: Connection refused
Any ideas why?
Fixed the issue by enabling ssh on mac. I didn't realize it was off as default! If you go into the sharing options in system preferences you can tick a box which enables ssh. To connect you must use: $ ssh username#192.168.1.111 (or whatever the ip is of the machine).

Connecting to Windows SSH Server

I am a newbie trying out SSH. The scenario is I have 2 machines - Windows 7 PC(Desktop) and a VMWare machine (Windows 7). Cygwin installed on both. I am trying to connect the VMWare machine to the desktop. I have installed the OpenSSH server on Desktop server. I verified it is running, using netstat.
I modified the Windows firewall, by adding to the Inbound Rules to allow connections for port 22.
My problem is I am unable to connect from the VMWare machine.
$ ssh -v user_name#my_machine
OpenSSH_5.5p1, OpenSSL 0.9.8q 2 Dec 2010
debug1: Connecting to my_machine port 22.
debug1: connect to address my_machine port 22: Connection refused
ssh: connect to host my_machine port 22: Connection refused
What am I doing wrong? What are my options to configure? Any links or answers would be helpful.
Thank you.
WM
Open your command prompt and run the following command:
ssh -v Your_User_Name#Your_IP_Address
If response is:
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
debug1: Connecting to Your_IP_Address port 22.
debug1: connect to address Your_IP_Address port 22: Connection refused
ssh: connect to host Your_IP_Address port 22: Connection refused
Then go to 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.
Now run above command again. SSH command will connect to the user.
You should make sure that my_machine allows inbound connection. Check the firewall....
(if you can run this command locally - but not from the other machine it might be that case).
If the ssh server on the Desktop is accessible in the localhost then try this
Desktop <- Desktop Firewall <- VM Firewall <- VM
Try shutting down the firewalls in between one by one to check where the issue starts after then configure accordingly. Remember that the Desktop Firewall rules should be inbound and the VM Firewall is outbound

Resources