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 have 2 ubuntu boxes in a WiFi network. Below is the 'ifconfig' of my destination machine.

But in my source machine, I tried 'ssh 192.168.1.2' I get connection refused.

$ ifconfig
eth0  Link encap:Ethernet  HWaddr c8:0a:a9:4d:d6:6a  
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
      Interrupt:35 

 wlan0 Link encap:Ethernet  HWaddr 00:23:14:32:e8:dc  
       inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
       inet6 addr: fe80::223:14ff:fe32:e8dc/64 Scope:Link
       UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
       RX packets:319828 errors:0 dropped:0 overruns:0 frame:0
       TX packets:618371 errors:0 dropped:0 overruns:0 carrier:0
       collisions:0 txqueuelen:1000 
       RX bytes:30642011 (30.6 MB)  TX bytes:921522542 (921.5 MB)

How to set up so that I can ssh from 1 box to another?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

There are a couple of things you need:

  • The IP address and credentials to login to the destination machine (obviously)
  • Make sure you can actually reach the other IP address. The ping command is your best friend here.
  • Remember that by default, root cannot remotely login via ssh. Use sudo
  • You need to make sure that openssh is installed. You can do this using Synaptics, search for openssh.
  • Look for a "meta package" for openssh. This will implement all needed components. Or just install openssh-server. You may have to accept other dependent packages to also be installed.
  • If you have a firewall installed, make sure that port 22 is open for inbound connection. This should be open by default.

Once all this is done, start the command-line prompt on the client machine, and enter the command:

$ ssh username@ipaddress Substitute "username" with the login id to use on the destination machine, and ipaddress with the full IP address of the server.

You can go without specifying the username. Then, the destination server will assume that you will login with the same username, only asking for the password.

In more advanced setup, you can look at setting SSH to listen on a different port. You can also use the certificate-based authentication. Look around on the internet for more documentation.

share|improve this answer

Make sure on the destination machine that port 22 is open and that sshd is running.

share|improve this answer
1  
in particular, sshd isn't installed by default; only the ssh client is. @michael will need to install the ssh or openssh-server packages from the Ubuntu repositories for the server. –  quack quixote May 3 '10 at 16:36

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.