LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   I want to access Linux Ubuntu on my virtual machine per winscp (https://www.linuxquestions.org/questions/linux-software-2/i-want-to-access-linux-ubuntu-on-my-virtual-machine-per-winscp-4175648034/)

webprog24 02-10-2019 05:17 PM

I want to access Linux Ubuntu on my virtual machine per winscp
 
I set up Linux Ubuntu on a virtual machine. Now I would like to access the server with the WinSCP Explorer. Somehow the connection is always rejected. I already read a lot of info on the internet but nothing really helped. I have also only outbound internet connection. If I try to ping the virtual machine from outside then this does not work.

scasey 02-10-2019 05:31 PM

Is sshd installed, configured and running on the VM?

michaelk 02-10-2019 07:18 PM

In addition,

What virtualization software are you running i.e VirtualBox, VMware etc.

It depends on how your virtual machine networking is configured.

berndbausch 02-10-2019 09:26 PM

How did you set up the network?

VM hypervisors provide several methods to connect a VM to the network, for example using NAT or by setting up an isolated network that is not accessible at all from the host.

webprog24 02-11-2019 03:24 PM

Virtual box
 
I installed OpenSSL per apt-get-install. And I use VirtualBox. I set the network adapter to Bridget adapter. Additionally to this i setup another Nat adapter.

michaelk 02-11-2019 03:54 PM

If configured with a bridged adapter your virtual machine will appear on the LAN just like any other device. Make sure that sshd is running and that you allow ssh through the firewall.

berndbausch 02-11-2019 03:59 PM

Quote:

Originally Posted by webprog24 (Post 5960742)
I installed OpenSSL per apt-get-install. And I use VirtualBox. I set the network adapter to Bridget adapter. Additionally to this i setup another Nat adapter.

I assume the VM host runs Windows, you try to access the VM on its bridged adapter, and you installed ssh, not ssl. Correct?

Does the VM have an IP address at all? You can check with ip address.
If not, give it one, either static or via DHCP, then try again.
If yes, is there any connectivity to the VM from the Windows PC? Use ping to check.
Is the sshd running on the VM? Can you access it with another ssh client such as Putty?

gosul33t 02-15-2019 02:29 AM

1. Configure your VM's NIC to work in 'bridge' mode so it can get an IP from the host's adapter.
2. Check if service sshd is enabled, if so, if it is started
3. Optionally, you can also check the ssh port (22 is the default one)


I think that pretty much sums it up.
I've tried it, it works.

webprog24 02-15-2019 03:07 PM

I did all esacly the way described above. I checked with

Quote:

ps -aux | grep ssh
if ssh is installed. It is installed. I did it before with
Quote:

apt-get install openssl-server
I checked if it has an ip address with
Quote:

ip address
and it showed me the static IP 192.168.2.xxx/xx
All seems to be correct but I can not connect to the server with putty or WinSCP also I can not ping the machine from outside. There is still something missing

michaelk 02-15-2019 04:03 PM

Is the ssh server running and is the Ubuntu firewall allowing incoming ssh traffic?

scasey 02-15-2019 04:12 PM

Sorry, but I still don't see that you've answered the questions we've asked.
You say you've installed openssl-server -- but that's not sshd -- so, again,
Is sshd installed and running? Yes,
Code:

ps -ef | grep sshd
would tell you if it's running, but better would be
Code:

netstat -tnlp | grep sshd
, which would also confirm it's listening on the default port (22).
In any event, you've only said you ran the ps command, not what the result of it was.

It's also not clear if you've done the things that michaelk and berndbausch have asked you about.

So, still at least a couple of possibilities:
  1. The VM networking is not set up correctly
  2. sshd is not installed, configured, and running on the VM
Either or both of these may be the problem.

berndbausch 02-16-2019 12:16 AM

Quote:

Originally Posted by webprog24 (Post 5962563)
I did all esacly the way described above. I checked with

if ssh is installed. It is installed. I did it before with

I checked if it has an ip address with

and it showed me the static IP 192.168.2.xxx/xx
All seems to be correct but I can not connect to the server with putty or WinSCP also I can not ping the machine from outside. There is still something missing

How about the opposite - can you reach out from the virtual machine?
Is the IP address in the same subnet as the hosting PC?

If you used bridged networking, the VM should sit on the same network as its host. Other conditions for reaching the VM are:
  • no firewall blocks traffic (Ubuntu doesn't implement a firewall by default, as far as I know)
  • host and VM are on the same subnet
  • the IP address is actually set on the VM's interface
I am not sure if anything is missing. In case of desperation, I would start using the big tools like wireshark on the PC or tcpdump on the VM.

webprog24 02-16-2019 03:51 PM

yes I checked all these things
 
1 Attachment(s)
The host has the IP address 192.168.2.103 and the guest VM has the IP 192.168.2.104 so that's the same subnet as far as I can see.

I can ping remote servers from this VM machine but not vice versa.

I checked the Windows 10 firewall and also enabled incoming IPv4 traffic for file sharing and printer access. That's really very strange as in other tutorials it works just fine.

If I try to login via PuttY it says (see the screenshot of auth.log)

Attachment 29825

berndbausch 02-16-2019 09:18 PM

Quote:

Originally Posted by webprog24 (Post 5962985)

If I try to login via PuttY it says (see the screenshot of auth.log)

First you say that you have no connectivity from the hosting Windows PC to the VM.

Now you say that trying to login (to the VM, I suppose) via Putty generates an entry in the auth.log (on the VM, I suppose).
How is this possible if there is no connectivity?

Could it be that you had us all trying to troubleshoot networking problems, when in fact you just don't enter the correct password? Or rather, by default Ubuntu doesn't permit logging on as root.

webprog24 02-17-2019 04:37 PM

No thats not correct
 
4 Attachment(s)
No, not at all. I typed in the correct password. Also in /ect/ssh/ssh_config I set PermitRootLogin to yes. But somehow it does not work. That's really frustration pure.

Here is the screenshot of my ssh_config file

Attachment 29838

The first network adapter I set to NAT with port forwarding.

Attachment 29839

Attachment 29841

The second adapter I set to bridged adapter

Attachment 29840

I checked so many things but its not working. Maybe the firewall of Windows blocks the connection but I did not find any precise info on how to solve this issue on the internet. If the password is the issue then the keyboard could be changed somehow but i also do not know how to handle this.


All times are GMT -5. The time now is 11:20 AM.