Can't connect to azure linux VM on port 9200, but ssh works - azure

Installed ElasticSearch on a linux VM in Azure, put in on a Vnet with a public IP and a security group with ports 9200 and ssh 22 open.
I can ssh into the VM. On the VM itself, I can reach port 9200.
But on my PC, when I try to hit the {public IP}:9200, I get a 502 bad gateway? Anyone know why?

Ok, needed to set the following line in the /etc/elasticsearch/elasticsearch.yml file;
BEFORE
#
#network.host: 192.168.0.1
#
AFTER
#
network.host: [_local_, _site_]
#

Related

Azure VM Connection Refused

I created a VM in Microsoft Azure with Ubuntu 20 in which I run a Tomcat Server exposed to Port 443 and 80 (redirecting to 443), Neo4j on Port 7474, and Jenkins on Port 8081.
I can't access neither of those ports, although I set all the Inbound Port Rules like this:
When I try to reach IP:PORT, I always get this:
I am kinda new to Azure. It is possible to log in to the servier via SSH in the Terminal. Can anyone help me? How can I access my Server?
Have you tried to access to the VMs by using SSH and looking whats going on with the logs ?!
Yes, you can connect to a terminal by SSH:
ssh -i <private key path> username#ipaddress
If you don't config your SSH key, you can use create you password on the Azure portal.
In your VM, on the left, you have many options, and one name reset password.

Azure VM and Visual Studio Code

I have an Azure VM running an Ubuntu 18.04 os. On this VM I created an NSG with Ports 80 and 22 Inbound rule. When trying to install VSCode on the VM, however, the code server starts on port 8080.
Then I tunneled port 8080 to 80, but I simply cannot establish a Connection from the browser to my VSCode when I try to load http://<public ip adress>:80
What am I doing wrong???
I thank you in advance for your help!
PuTTY Configuration
Run VSCode on Ubuntu
NSG Rules
Your server is listening only on interface 127.0.0.1 which represents your VM. If you want to listen on any address (including your public IP), let your server listen on 0.0.0.0 instead.

Cannot connect to neo4j running in droplet but using lynx to navigate to localhost:7474 works, ufw & digital ocean firewall configured

I'm running a brand new droplet in digital ocean running on Ubuntu 18.04.3 (LTS) x64, neo4j status is active and remote interface available on port 7474.
Using lynx via ssh to browse to localhost:7474 works, neo4j is alive and active.
Pinging works
Firewall asigned to allow all traffic but also specifically those ports
Browsing to the ip address on any port does not work
Used ufw to manually add port 80, 443, 7474 to allow access
Cannot connect via browser to the droplet on any port
Firewall configuration:
UFW Status:
Can you make sure the following line in your neo4j.conf file is uncommented :
# With default configuration Neo4j only accepts local connections.
# To accept non-local connections, uncomment this line:
dbms.connectors.default_listen_address=0.0.0.0

Why do I get an error when connecting to port 80 between guests

I have two VMs. Both on the nat (vmnet8) adapter. Both machines appear to be on the same subnet.
Guest1 - 192.168.18.146
Guest2 - 192.168.18.150
I can ssh between the machines. However, when I try http it fails:
[root#localhost conf]# wget 192.168.18.146
--2016-02-18 09:53:03-- http://192.168.18.146/
Connecting to 192.168.18.146:80... failed: No route to host.
How can I access a webserver hosted on guest1 from guest2?
I have also tried a custom adapter and bridged with the same result.
OS firewall issue. I originally verified that iptables was not running but another service, firewalld was running and blocking access to port 80. Disabling the firewall allows me to access port 80 from my guests and host.

telnet to azure vm port from outside

I want to telnet virtual machine on port 1234. I have server.exe running on vm which listens to port 1234.
When I run telnet within virtual machine cmd "telnet 127.0.0.1 1234" response is
"ok"
However when I run telnet from outside using "telnet publicIP 1234" response is
Connecting To publicIP...Could not open connection to the host, on
port 1234: Connect failed
I have added endpoints in azure portal and tried switching off the firewall from both virtual machine and my local machine.
Can anyone please suggest?
Two things to consider:
Make sure that your server.exe listens also the VM network adapter, but not only on 127.0.0.1
Make sure that your ISP( Internet Provider) does not block outgoing ports - very common issue.
To avoid (2) change the public port for the VM Endpoint to 80 and try with telnet publicIP 80
To make sure you comply with (1), while on the VM try telnet **localIP** 1234

Resources