Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am very new to linux and literally just started using it last weekend. I am playing around with getting a server up and running and I am trying to get SSH to run on my machine. I installed openSSH-server through aptitude and based on various tutorials online that seemed to be all I needed to do. However, I still cannot login through PuTTY on a remote machine. When I ran chkconfig it said that SSH was turned off and I have no idea how to turn it on. Not only that, but I'm not sure what IP to use from ifconfig. eth0? lo? Which one? Can somebody please instruct me on how to turn on SSH, and what IP address I'm supposed to use to connect to it?

Not sure if this is relevant, but I'm running it through VirtualBox because I'm waiting on a server computer.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

To enable SSH server:

  1. Install SSH Daemon --> sudo apt-get install openssh-server
  2. Check your Linux VirtualMachine (VM) IP address (ifconfig - eth0 / eth1)
  3. From your host machine, use Putty (or other telnet client) and connect to the IP address of the eth0 / eth1 (or other similar things)

Some explanations: lo - Loopback link - this link goes to itself. eth0 / eth1 / eth? - is usually your LAN / network connection.

And also since you mentioned you are running on a VM using VirtualBox, make sure on the Virtualbox VM setting, you set the Network as "Bridged". Bridged Connection allows the VM to have their own IP address directly from the router / DHCP server on the network where the host is connected to.

If you have it as NAT or Internal Only, it will not work.

If you already have them configured as NAT or Internal Only, change the network to Bridged, and then restart your VM, and you should get an IP address that you can actually connect to.

share|improve this answer
    
Awesome. I just needed to change the network setting to bridged. Thank you sir. –  Snip3r May 27 '13 at 22:06

You can start SSHd with

sudo service ssh start

though you are correct in that it should start automatically. If you run

netstat -ln | grep 22

then you should get the following in the response if it's set up correctly:

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN

That means you can use any of the machine's IPs to connect. Figuring out how to reach the machine is dependent upon your virtual machine and how you have networking configured in it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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