Cannot list directory on IIS FTP server on Azure, even after configuring Azure inbound rules and Windows firewall - azure

I'am running Windows Server 2012 in Azure, and I've configured the FTP server in IIS. When I try to connect the server, it accepts the username and password and log me in but not showing the directory listing.
I've tried using FileZilla FTP client to connect and it saying the same error.
Status: Resolving address of jothiprakashanandan.southindia.cloudapp.azure.com
Status: Connecting to 104.211.244.241:21...
Status: Connection established, waiting for welcome message...
Status: Insecure server, it does not support FTP over TLS.
Status: Logged in
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is current directory.
Command: TYPE I
Response: 200 Type set to I.
Command: PASV
Error: Connection timed out after 20 seconds of inactivity
Error: Failed to retrieve directory listing
Status: Disconnected from server
The inbound rule of Azure is this:
The VM's firewall inbound rule.
However when I try to login from the VM's browser it is working fine and showing the directory list.

In Azure, we should deploy the passive mode FTP, we should add data channel ports range in FTP Firewall Support, then add those ports to NSG and windows firewall inbound rules.
By the way, although the windows firewall seems to allow all traffic that’s required, we also need to enable stateful FTP filtering on the firewall:
netsh advfirewall set global StatefulFtp enable
Then restart the FTP windows service and we should be up and running:
net stop ftpsvc
net start ftpsvc
Here is a similar case, same error as you, please refer to it.
Check which port does the FTP site listen on:

It is usually necessary to restart the Microsoft FTP service after enabling the FTP server rules in Windows firewall to have the change take an effect.
Or restarting a whole machine.
See my guide to Installing an FTP Server on Windows using IIS.

The issue was with Azure network NSG. you need to enable the port range on which data is getting transferred.
Added new rule in NSG to open this port range and it worked.

Related

Connect to remote Azure Linux machine through ssh Visual Studio Code

I want to connect to an Azure machine on which is installed an Ubuntu distribution.
I can connect or through ssh or, by installing some other software, by using X2Go.
However, I don't need the UI and if it's possible I would like to use Visual Studio Code.
On this last I've installed the ssh component and I've already used it to connect to other machines.
Unfortunately I'm not able to connect to the Azure machine by using VS Code.
The ssh connection works, I tested it by connecting through the terminal.
The connection string is in the following for:
(user_name)#(machine_name).westeurope.cloudapp.azure.com
I'm not the system administrator and I don't know the public IP.
I think the problem is the ssh port, I read that the standard port for ssh is 22 while I have 53044.
On VS Code I tried the following solution:
connection string: (user_name)#(machine_name).westeurope.cloudapp.azure.com:53044
I added the connection info into the config file with this format:
Host Linux_Azure
HostName (machine_name).westeurope.cloudapp.azure.com
User (user_name)
Port 53044
None of them work.
With the first solution VS Code tries to connect forever, failing with no error messages.
With the second solution VS Code gives back this error message: Could not establish connection to "Linux_Azure": The connection timed out.
I don't understand why it doesn't work, and I don't know how to solve it.
Do you have any idea to solve it?
I deployed one Ubuntu VM and tried connecting to it via SSH in VS code and got connected successfully with Port 22 like below:-
ssh siliconuser#siliconlinuxvm123.centralindia.cloudapp.azure.com -p 22
Output:-
When I tried connecting with port 53044, Even I got the same error code as yours like below:-
By default Azure Linux VM uses Port 22 to SSH, You cannot change the default destination port as it is fixed for a particular protocol. Example For RDP - Port 3389 is used, For HTTP- Port 80 and for SSH- Port 22 is used.
When I try to allow SSH in the inbound rule on VM's Networking Page > Port 22 is selected by default and greyed out thus we cannot add other port as a destination range refer below:-

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.

Cannot SSH to Azure VM

I have a Ubuntu VM on Azure (Resource Group, not the Classic VM) and it all worked out of the box. I recently tried to SSH into the VM using Putty and I could not.
I get the error: Network Error: Connection Timed out.
I have made sure that the port 22 is opened for SSH on the VM Inbound rules.
I had this VM setup about 2 months ago for a side project and at that time I was able to SSH easily without any troubles. Now I can't. Am I missing something?
PS: The HTTP works fine. I have the website running on it and it shows up in the browser. Also, I tried using a browser-based SSH client and it was able to SSH into the VM.
Looks to be an issue with the local firewall. Try resetting the SSH configuration in the portal.
Go to Azure Portal
Select VM in question
Select Reset
Password
Select Reset Configuration Only
Select Update
I am adding this because it might help someone, the chosen answer did not work for me
for some reason the firewall on the ubuntu server
Go to Serial Console type in your ssh username and you will be logged into the server
Check the firewall status to see if port 22 is allowed
sudo ufw status verbose
If the rule is not there then add it
sudo ufw allow ssh
I encountered the same issue. The following is how I solve this issue:
Don't add any port While creating your VM, do it only after only the VM is created
Add the port 22 in the networking tab until the VM status is Running.
When a new VM is created on Azure, by-default the Protocol TCP on Port 22 is Disabled. Need to allow this.
Follow:
https://medium.com/techinpieces/practical-azure-how-to-enable-ssh-on-azure-vm-84d8fba8103e
Create below directory : mkdir -p /run/sshd
Then restart service : systemctl restart ssh
This will definitely solve your issue.

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.

Server is started, application is running but not accessible in browser

My client has provided an ip is 192.168.1.205 of linux machine on which JBoss server & mySql db are installed and accessible after VPN connection only.
Previous Status Summary
VPN connected ...
Deployed EAR application to server <JBOSS_HOME>/server/default/deploy/
Start Server e.g.
#<JBOSS_HOME>/bin:> ./run.sh -b 192.168.1.205
Application access in browser : success
Now client has provided a public IP (119.55.15.165) and says application can be accessed without VPN connection. I did the same as above but neither application is accessible via public ip nor #192.168.1.205 after vpn connection while i can see the process id and server log file which proves that JBOss is started and application is running.
As i tried to start application service with following command but deployment got failure
#<JBOSS_HOME>/bin:> ./run.sh -b 119.55.15.165
Status: Deployment Failure
#<JBOSS_HOME>/bin:> ./run.sh -b 192.168.1.205
Status: Deployment Success, Server started, Appl'n running but not accessible in browser
Please help me out on this.

Resources