0

I can't connect to my kali linux ssh server running in Virtualbox through puTTY. I didn't make any changes to /etc/ssh/sshd_config file, besides Port and PermitRootLogin

That's how i booted up my ssh server (openssh-server installed)

root@yasumi404kalimain:~# service ssh start
root@yasumi404kalimain:~# service ssh status
● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; disabled; vendor preset: 
disabled)
   Active: active (running) since Fri 2019-06-14 13:15:13 EDT; 3s ago
     Docs: man:sshd(8)
       man:sshd_config(5)
Process: 1694 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 1695 (sshd)
Tasks: 1 (limit: 4915)
Memory: 1.2M
CGroup: /system.slice/ssh.service
       └─1695 /usr/sbin/sshd -D

июн 14 13:15:13 yasumi404kalimain systemd[1]: Starting OpenBSD Secure Shell server...
июн 14 13:15:13 yasumi404kalimain sshd[1695]: Server listening on 0.0.0.0 port 6886.
июн 14 13:15:13 yasumi404kalimain sshd[1695]: Server listening on :: port 
6886.
июн 14 13:15:13 yasumi404kalimain systemd[1]: Started OpenBSD Secure Shell server.
root@yasumi404kalimain:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
    inet6 fe80::a00:27ff:fe1b:142c  prefixlen 64  scopeid 0x20<link>
    ether 08:00:27:1b:14:2c  txqueuelen 1000  (Ethernet)
    RX packets 3  bytes 778 (778.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 26  bytes 2260 (2.2 KiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
    inet 127.0.0.1  netmask 255.0.0.0
    inet6 ::1  prefixlen 128  scopeid 0x10<host>
    loop  txqueuelen 1000  (Local Loopback)
    RX packets 18  bytes 1038 (1.0 KiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 18  bytes 1038 (1.0 KiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

And that's what I got when tried to connect.

When tried to connect via Andrax on android, being connected to the Wi-fi router which is in the same LAN as the computer. Andrax via android

And when I also tried using puTTY in the host system of virtual machine.

putty settings enter image description here

How do I solve this problem? Also, will I be able to connect to ssh server while being not in the same network, or I will need a static IP to do that?

I apologize in advance if mistake I made is silly, I'm new to infosec. I will be happy to provide additional information/logs if needed.

UPD: I tried changing ListeningAddress to 10.0.2.15, result is still the same. (i restarted the ssh server and tried to connect)

closed as off-topic by Steffen Ullrich, Xander, schroeder Jun 15 at 15:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about Information security within the scope defined in the help center." – schroeder
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Thus looks like a pure connectivity problem unrelated to security. I recommend to move it to superuser.com. – Steffen Ullrich Jun 14 at 18:07
  • @SteffenUllrich Thanks, I'll go there then – gdl68 Jun 14 at 18:08
  • The virtualbox is probably not bridged or in the same subnet.Try pinging the virtual box and then the run nmap to see if you see if port 22 is open. – Vipul Nair Jun 14 at 18:57
  • @VipulNair That was the problem, thanks for the answer. Though, I used port 6886 instead of 22. – gdl68 Jun 14 at 19:15
  • Glad it worked out man. – Vipul Nair Jun 14 at 19:51
2

The problem is that I didn't connect my Virtual machine to the bridge adapter, so I can't get access to it. I should've just add it in the VM's settings, and all started to work well!

Not the answer you're looking for? Browse other questions tagged or ask your own question.