How can I connect via SSH (Putty) to my VMWare machine (Ubuntu)?

20

10

I'm trying to connect to my VMWare (Workstation 7.1.3) machine (Ubuntu Lucid) via SSH. I've read through some other posts, but I can't figure this out. I ran ifconfig, and got a inet addr: and Bcast and Mask: which appear to be IP addresses. If I try to connect via Putty SSH to any of those addresses, it doesn't work. I also tried connecting to my IP address (from whatismyip.com).

Note: This is all taking place on the same desktop computer.

orokusaki

Posted 2010-12-28T20:07:37.010

Reputation: 1 044

Can you ping the 'inet addr:' of your VM from the desktop computer ? – None – 2010-12-28T20:28:16.727

It is important that the Network Adapter in the VM settings be changed to the Bridged mode. – amphibient – 2013-08-19T19:54:01.470

Answers

36

Is the package openssh-server installed on your Ubuntu VM? You'll need that package if you want to connect to it by SSH.

You can make sure by opening a terminal (through VMWare's console, I guess) on Ubuntu and running:

sudo apt-get install openssh-server

fooraide

Posted 2010-12-28T20:07:37.010

Reputation: 476

18

How to do it? Here are the complete steps. Just follow these steps:

  1. In the terminal use command: sudo apt-get install openssh-server

  2. Switch to bridged networking mode, make that change in the Virtual Machine Control Panel (Edit > Virtual Machine Settings)

  3. reboot the VM

  4. Run "ifconfig" command in terminal & get "inet addr" of "eth0"

That's all ! Now use this IP to connect via ssh (I use Putty in my Windows 8)

Rajat Gupta

Posted 2010-12-28T20:07:37.010

Reputation: 613

7

If the network is configured properly - either with port-forwarding or as "bridged" and SSH is still not working (from the question text that seems to be the case), then it's either that ssh is not installed or not running. For example, ssh is not running by default on Kali although it's already installed. You'll have to run it yourself.

To start the ssh service:

service ssh start

guya

Posted 2010-12-28T20:07:37.010

Reputation: 211

1This is as valid answer as the approved one. If the network is configured properly - either with port-forwarding or as "bridged" and SSH is still not working (from the question text that seems to be the case). Than, it's either that ssh is not installed or not running. For example, ssh is not running by default on Kali although it's already installed. You'll have to run it yourself. – guya – 2015-04-05T23:32:38.467

1As a person who only uses Linux occasionally this is the sort of thing that always trips me up. – tt9 – 2016-10-20T05:41:53.777

1

Check if the SSH is allowed or not allowed in your firewall settings, if you use Linux with a GUI it might be like this:

Click on system -> Administration -> security level and firewall

Click on firewall option tab, enable it, apply and save.

Here you can allow telnet and https as well. Thanks

Zahid

Posted 2010-12-28T20:07:37.010

Reputation: 11

-1

On my Centos I connected this way. Setting up internet connection (NAT, BOOTPROTO=DHCP ) , service network restart. Then find out IP - ip a - and use this IP in putty.

Honza Micka

Posted 2010-12-28T20:07:37.010

Reputation: 9