ssh: Connection refused while trying ssh from host (centOS 6.5) to guest server (on oracle virtual box, ubuntu 15) - linux

I have setup ubuntu 15 on oracle virtual box on centOS 6.5 (host), using Bridged Network utility. When I'm login from guest server to host server using ssh, it works fine but if I am trying to login from host server to guest, it throws an error:
ssh: connect to host 10.0.41.143 port 22: Connection refused
FYI,
Host IP: 10.0.61.49
Guest IP: 10.0.41.143

Adding as an answer (copied from my comments on the OPs question) so that others may find the answer more easily. (and Hemant can mark it as correct :) )
Is the ssh daemon running on the guest?
There is a ssh client (the one you use to login from) and a ssh server - the target machine you're trying to login to .. you may have the client on the guest, but not the server (sshd)

Check for firewall. It could be blocking the incoming connection on port 22.

Thanks FreudianSlip,
I had only ssh client on my guest server, but not ssh-server daemon.
Installation of ssh-server, resolved the problem :)

Related

ssh: connect to host ********* port 22: Connection timed out

I have Ubuntu 22.04 newly installed on my laptop. I am trying to connect to a remote server and getting the following error:
ssh: connect to host ********* port 22: Connection timed out
I tried some solutions which include,
ping the IP address
adding the IP address to the firewall using sudo ufw
installing ssh and openssh
However, nothing seems to work. I'd be thankful if someone can help me to solve this problem.
If you can ping the server it can be the following causes:
The server is not answering ssh, sometimes ssh server is not up or it is answering in another port.
There is a firewall blocking your request.
You do not need to install the openssh server in your computer to access a remote hosts and normally outbound connections are allowed by ufw.
ssh: connect to host ********* port 22: Connection timed out
I have this kind of problem too I contact the server admin and said the operation system should be install again due to some problems
after re installing the problem solved try it it may works

Docker Postgresql can't connect remotely

I can connect my docker postgresql in my local server windows via ip or localhost. When I try to connect it remotely from my personal windows I have timeout error. Thinking about 5432 port is blocked or not listening.
I have changed pg_hba.conf & postgresql.conf files for remote connection and also checked for firewall but it was disabled.
Answer is I should have checked my server's firewall conf also, just dockerVM is not enough :)

Linux to windows connection refused

I'm sure my lack of linux knowledge is what's causing this problem. I created a program in C# which uses QuickFix to do various things. I need this program to run on linux so I created an ubuntu virtual machine and recompiled the program with mono. The application starts ok but can't connect to my simulated exchange running on a windows machine. The error log returns Connection failed: Connection refused.
Could it be that I haven't setup linux properly?
Thanks
See if your VM can actually connect to that port (while the windows application is listening) with telnet:
telnet <ip> <port>
If telnet can't connect to the port, then you should probably check your VM network configuration, the interface configuration on ubuntu, and probably the firewall (both on windows and linux). Run ifconfig to see how your network is configured.

How to access nginx server from host machine, installed on guest VM ?

Host Machine - Win 7
Guest - Fedora
I have installed nginx web server on guest fedora machine and I can access the webpage inside guest machine using the interface address. How can I access the web page from host machine's browser ?
I am using bridged connection.
Router is assigning 192.168.0.16 to the guest machine's interface. I tried same address in my host machine but it doesn't work.
Based on your description:
First you should check your web application's config. You don't mention which type of your web application running on your Apache server, some are launched with the specific ip argment 127.0.0.1( or localhost), so kind of these web application can only be visited on your localhost computer. You should change the ip argument to 0.0.0.0
Second if the "Fisrt" failed, check the connection of the two server(host and your guest) by using telnet.
On your Win7, you can use the command:
telnet ip port
for example:
telnet 192.168.0.16 80
80 is the default port of Apache Http(s) Server.
if the command don't show the "connection refused" error, your Apache server is goood, so it might be something wrong of your web application.
If that, show me your error msg then we go on further.

WHM - Console not working

I have VPS with CENTOS 6.4 x86_64 virtuozzo – vps9458 and WHM 11.34.1 (build 14). I am trying to connect server by Putty but I am only getting below error:
server unexpectedly closed network connection
My WHM url look like this 1.2.3.5:2087 and in putty I am using 1.2.3.5 as Host name and 2087 as port. I always see error above.
Please guide what I am doing wrong.
Thanks
Usually connecting via putty using SSH you will need to be on port 22. So try port 22 instead.
2087 is for cpanel/whm and is meant for the web browser only.
If it still doesn't work email your web hosting provider.

Resources