0

I'm currently running Ubuntu in a VMworkstation Pro, when I try to SSH into it, the connection is rejected. But, I can ping Ubuntu IP successfully.

NerdOfCode
  • 2,408
  • 4
  • 16
  • 33
ClydeB
  • 1
  • 1
  • 2
  • `ssh -v theServer` will show more information. – waltinator Jan 06 '18 at 22:46
  • have you enabled openssh-server? (sshd) a default install sets up ssh only for outgoing, not incoming. – guiverc Jan 06 '18 at 22:57
  • No not specifically. I'm new to all of this. How do I check or start the openssh server. – ClydeB Jan 06 '18 at 23:07
  • I'm using Putty from my Windows 10 laptop to ssh to the Ububtu VM. – ClydeB Jan 06 '18 at 23:08
  • `sudo apt install openssh-server` ssh on Ubuntu largely refers to the client software which allows you ssh TO another box. sshd/openssh-server is the system daemon or server part of it which allows ssh INTO the box. (specifying version of Ubuntu may help - my answer is consequentially generic) – guiverc Jan 06 '18 at 23:20

3 Answers3

2

You need to start and enable (so that it runs on system startup) the SSH server:

sudo systemctl enable ssh.service
sudo systemctl start ssh.service
nixpower
  • 1,200
  • 5
  • 18
1

You first need to install openssh-server package using the following command:

sudo apt install openssh-server -y

Make sure to activate the service and check if it really is:

sudo systemctl start ssh
sudo systemctl status ssh

To be sure that it is enabled at boot, execute the following command:

sudo systemctl enable ssh
Kian
  • 333
  • 2
  • 8
0

If you are trying to connect from a Windows 10 machine, then Microsoft SSH may be getting in the way. You need to change the port in /etc/ssh/ssh_config in the VM to something other than 22. For example, if you choose 2222, then you would tell putty to also connect to port 2222.

Feldspar15523
  • 381
  • 2
  • 16