SSH but not ping [closed] - ssh

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I have an Ubuntu VM (running on MacOS host) and am trying to connect to another box that is running Linux (busybox, IIRC).
I can ssh from machine A (Ubuntu-VM) to machine B (busybox). I can ping from A -> B, but I cannot ping from B -> A.
Machine A has IP of 10.0.2.15, B has IP of 10.1.10.216.
My ultimate goal is to be able to use wget on B to get files from A, and I'm hoping that solving this ping problem will allow B to see A and allow magic to occur.
My network comprehension is near zero, so this is probably trivial, but any help greatly appreciated.

As you are using a NAT interface, Virtualbox will mask all the traffic from your virtual machine to the outside network using the IP address of the host. To clarify this, the traffic that is arriving to computer B is from 10.1.10.97 (Your MacOS host), and that is why B can return that traffic to A, because it is actually sending it to the host and Virtualbox is translating the destination address to the NAT'd virtual machine.
You have two alternatives:
Change the adapter type to Bridged (This will change the IP address on the Ubuntu machine but is also the easiest if you have little networking knowledge).
Forward a port in the host to the machine A (I see this as the most suitable solution without changing the architecture)
For case 1 is as easy as change the settings in Virtualbox and then get the new IP.
For case 2, what you should do is go to the Machine Settings, in the network section, expand Advanced and set a port forwarding, for instance:
In this way, from computer B you will be able to wget from the host IP (NOT the 10.0.2.15, the 10.1.10.97) on port 8080, and this traffic will be forwarded (Destination NAT'd) to 10.0.2.15 using: wget http://10.1.10.97:8080/path/in/ubuntu
You will never be able to point directly from 10.1.10.216 to 10.0.2.15 as machine B has no routes to 10.0.2.15
I recommend you read a little bit about NAT (https://en.wikipedia.org/wiki/Network_address_translation)
There's a lot of assumings in this answer, I hope it helps.

Related

Access correct website file from apache web server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I am running an apache web server on my Raspberry Pi that hosts a website. To get the IP address of the server i used ifconfig and looked for the inet address under wlan0. I typed this address into chromium and reached /var/www/html/index.html. I do not want to reach this file, instead i was hoping to configure the server so that the first site i reach is /var/www/test/index.php.
How can i achieve this?
First, you need to change the document root of apache to point to the /var/www/test directory.
For this I advise you to follow this explanation : https://askubuntu.com/a/738527
And then normally you will be able to access your page from other computers using the IP address of your PI.
If you only have one webpage running on the Pi, you need to change the document root of the apache.
A better solution is, to use virtual hosts with apache. Depending on the OS on the Pi there may be different paths for the Apache config files. I only know it for Debian (Raspbian).
Then you have to enable the virtual host (a2ensite <configfile.conf>) and reload or restart Apache.
If you are running a local Nameserver (like PiHole), you have to add the correct DNS entry for this virtual host. Or if you don't have a local DNS you have to edit the /etc/hosts files on all machines you want to have access to this website. (There is also a hosts file on windows (i think it is in \Windows\System32\drivers\etc)
Thats it :-)

VM Network settings for a Wireless Connection of a Laptop [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I have an Apache Web Server installed on Ubuntu 16.04 in a VM, the problem I'm having is that my server doesn't seem to have its own IP address. I tried using hostname -I but only a blank line appears, while ifconfig shows 127.0.0.1 and 10.0.0.2.
The problem I suspect is that it's related to the network settings of my VM since when I imported it to the computer laboratory at school, the commands hostname -I and ifconfig showed an IP address like 192.xxx.x.xx, I tried searching around but I can't find similar problems where the host machine is connected to a router via wireless connection. What can I do?
EDIT:
VM software being used is Oracle VM VirtualBox Manager
Network Settings:
Because "Bridged Adapter" is used the router acts as DHCP server.
There are 2 solutions if you want to access a server located at VM from host without network connected:
Set adapter as Internal network see details
Note: in this case Internet cannot be accessed through this interface.
You would probably like to add another Bridged or NAT adapter to acceesss external network
or NAT details (how to setup)

Accessing multiple hosts via SSH on the same public IP [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have an issue in which I want to connect to a different host computer that exists on the same public IP (Say, 82.90.233.234). Are both forwarded to the same port? For example, I connect my Raspberry pi using pi#82.90.233.234, which I can do easily. But I also have a desktop I want to access via SSH at a different desktop#82.90.233.234.
Is there a way that is can be accomplished?
Disclaimer: Those are not actual IPs.
For example, I connect my Raspberry pi using pi#82.90.233.234, which I can do easily. But I also have a desktop I want to access via SSH at a different desktop#82.90.233.234. Is there a way that is can be accomplished?
If you are actually using different usernames as in your example, you could have one computer listening for ssh connections # 82.90.233.234, and for user pi spawn a shell session and for user desktop automatically spawn an ssh session to your desktop host.
You could set up port forwarding so that the default port 22 would be your raspberry pi, but connecting to port 2200 would forward to an ssh server on your desktop. You could set up aliases in your local .ssh/config file:
Host pi
Hostname 82.90.233.234
User pi
Host desktop
Hostname 82.90.233.234
User desktop
Port 2200
With this in place, you could ssh pi or ssh desktop and ssh would pick the remote username and remote port from your configuration file.

How can I SSH directly into a VMWare virtual machine from an external computer? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I am running Kali Linux on Virtual Box on my personal computer. There is another computer on the same network that has a virtual machine on it. I want to SSH directly from Kali Linux (on my computer) into that other computer's virtual machine directly.
I don't want to go through two steps (SSH into the other computer, then SSH into its virtual machine). The other computer uses VMWare Player as its virtualization software. Its guest is metasploitable.
Any ideas?
EDIT: The VM on the other machine needs to stay in NAT mode for my purposes.
Is openssh-server installed on your Kali Linux VM? You'll need that thing if you want to SSH into it.
You can make sure by opening a terminal / console (on the console inside Kali Linux) and putting in:
sudo apt-get install openssh-server
Then ssh using:
ssh user#ipaddress:port
Does this work for you?
You need to put your VMware Player network adapter into bridged mode. This will make the VMware Guest visible to the other computers on your network including to your VirtualBox guest.
If the VM needs to stay NATed then you will have to create a port forward rule on port 22. To do that you need to make sure that vmnetcfg was installed when you installed VMWare Player.
Open that Utility by going to the directory where you installed VMware Player and run vmnetcfg.exe. From there you will be able to create a port forwarding rule by choosing your VMs network adapter and selecting "NAT Settings". There is a section of that menu where you can create port forwarding rules. You'll want to forward port 22 to the VM (unless you've changed the ssh port on your server, then forward whatever that port is).
If you don't have that tool installed, you can get it by running
VMware-player-?.?.?-??????.exe /e .\VMTools
Then from your Kali box you can ssh to the IP of the VMWare host machine and the ssh traffic will get passed through to the VM.

Can't ping a local VM from the host [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
My work laptop is is a member of a domain (the OS is Windows 8). Created a new VM, locally on this laptop (using built-in Hyper-V). DHCP is provided by the domain and all IP addresses are assigned by the DHCP, both to the host and to the VM. The VM is not a member of the domain, just a member of the WORKGROUP. Trying to ping a local VM from the host. Pinging by machine name does not work. Pinging by IP address works just fine. Both host OS and the VM are on the same sub-network.
The IP addresses change every time I reconnect the laptop to office network. I would like to avoid the pain of using different IP's all the time.
Is there anything I can do on my end to make names resolution work? Adding the VM to the domain is not an option.
I know this is an old post, but I ran into this same issue with my VMs. Log into the VM and go to Control Panel > System and Security > Windows Firewall > Allowed Apps. Then check all of the boxes next to "File and Printer Sharing" to enable file sharing. This should allow you to ping the VM. The screenshot below is from a 2016 Windows Server but the same method will work on older ones.
The issue could be that the VM is connected to the network via NAT. You need to set the network adapter of the VM to a bridged connection so that the VM will get it's own IP within the actual network and not on the LAN on the host.
I had a similar issue. You won't be able to ping the VM's from external devices if using NAT setting from within VMware's networking options. I switched to bridged connection so that the guest virtual machine will get it's own IP address and and then I added a second adapter set to NAT for the guest to get to the Internet.
try to drop the firewall on your laptop and see if there is difference.
Maybe Your laptop is firewall blocking some broadcasts that prevents local network name resolution.
On top of using a bridged connection, I had to turn on Find Devices and Content on the VM's Windows Server 2012 control panel network settings. Hope this helps somebody as none the other answers worked to ping the VM machine.
Try dropping all the firewall, the one from your VM and the one from you Laptop, or add the rule in your firewall where you can ping
Maybe your VMnet8 ip is not in the same network segment, e.g., my vm ip is 192.168.71.105, I can ping my windows in vm, but can't ping vm in windows, so this time you may check if vmnet8 is configured right.
IP: 192.168.71.1
I had the same issue. Fixed it by adding a static route on my host to my VM via the VMnet8 adapter:
route ADD VM_addr MASK 255.255.255.255 VMnet8_addr
As previously mentioned, you need a bridged connection.