2

I am doing everything as I find in tutorials:

  1. Start Gnu/Linux in Virtualbox
  2. In terminal of the Gnu/Linux in Virtualbox type ip a and get:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo 
        valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
        valid_lft forever preferred_lft forever
2: enp0s3: <BRADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether <censored> brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute enp0s3
        valid_lft 86087sec preferred_lft 86087sec
    inet6 fe80::3550:bab0:c3a:b439/64 scope link noprefixroute
        valid_lft forever preferred_lft forever
  1. Close the Gnu/Linux in Virtualbox
  2. Co to settings of Virtualbox
  3. Set Virutalbox settings for Linux:
    enter image description here
  4. Run Gnu/Linux in Virtualbox
  5. Type in terminal window: ssh 127.0.0.1 -p 2222 -l tester010203044 where tester010203044 is the user-name of the Gnu/Linux in Virtualbox, and get this error message:

    ssh_exchange_identification: read: Connection aborted

I am new to Gnu/Linux. I just want to copy files into Gnu/Linux in Virtualbox from Microsoft's windows.

Running in verbose mode gives:

debug1: Connecting to 127.0.0.1 [127.0.0.1] port 2222.
debug1: Connection established.
debug1: key_load_public: No such file or directory
(...)
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7
(...)

SSH-2.0-OpenSSH_for_Windows_7.7 Maybe this is the problem? I got Windows 10.

  • Windows firewall maybe? Can you bring it down and retry? – realpclaudio Feb 08 '20 at 22:18
  • Switching firewall off didn't help – tester01020304 Feb 08 '20 at 22:22
  • It's normal, but just a test to check where the issue could be. If you don't want to bring down firewall try to switch VM interface from nat to bridge, so you will test with host and guest on same lan. – realpclaudio Feb 08 '20 at 22:26
  • I have been trying to use bridge too and it doesn't work too – tester01020304 Feb 08 '20 at 22:42
  • What you did makes sense. And the error seems to be at the ssh level, not the port level: it looks like it connects to the ssh server, but then there is a problem. So some problem with ssh. This similar question may help https://serverfault.com/q/445045/111338 or https://unix.stackexchange.com/q/128894/4778 – ctrl-alt-delor Feb 08 '20 at 22:43
  • Run ssh in verbose mode. If that does not help then look at logs of sshd on server. – ctrl-alt-delor Feb 08 '20 at 22:47
  • I have added logs from verbose mode to the question... – tester01020304 Feb 08 '20 at 22:57
  • 2
    Can you get a command line inside the VM? Check to see if sshd is actually running and something is actually listening on port 22. – Kenster Feb 08 '20 at 23:12
  • 1
    (1) 7.7 is the version of OpenSSH that was ported to Windows (2) on Virtualbox NAT, 'aborted' often occurs when there isn't actually anything listening in the VM (on a real machine this causes connect to fail, but this isn't a real machine) (3) 'Gnu/Linux' is not one thing, there are thousands of variants and the differences matter -- is it one of these or something else? – dave_thompson_085 Feb 09 '20 at 05:11
  • It works now! All I need to do is run sudo apt-get install openssh-server openssh-client on linux ;D – tester01020304 Feb 10 '20 at 21:13

2 Answers2

5

Issue is with your virtual box machine. By default ssh came in ubuntu 18.04 but openssh-server will not be there. I tried to re-produce your scenario & got the root cause of issue i.e

ssh_exchange_identification: read: Connection aborted

Solution is as below:

  1. Install openssh-server as root user
    apt install openssh-server
    
  2. Try now
    ssh <username>@192.168.0.103 -p 2222
    

This will work. Let me know if you face any issue.

AdminBee
  • 22,803
zcoder
  • 51
2

Try removing the host IP from the table. Also have you install and enable the sshd daemon, if you haven't done that it won't work. Check if ssh is installed, and the daemon is enabled. This also how I have my IP table setup.

enter image description here

Hopefully this helps

GAD3R
  • 66,769