using SSH with an Ubuntu intranet

September 28, 2013

SSH (Secure Shell) is a method of connecting to a computer remotely, giving you (depending on user permissions) full access to the files on that computer.  Obviously this is a huge security risk — if someone cracks your password, they’ll have complete access to your computer.  For this reason is generally recommended not to use passwords at all with external SSH connections, and so I’ll just be mentioning using SSH to connect to other computers on your local intranet.  Why use SSH?  While Windows has all sorts of relatively easy (and head-bashingly buggy) tools like “Network Discovery”, Ubuntu doesn’t default to easy intranet sharing like this.  In fact, this was one of my biggest frustrations when I first switched to Ubuntu, until I found SSH.

To install SSH, simply type “sudo apt-get install ssh” at the command line.  As usual you’ll be prompted for your root password.  Unless you already have ssh installed you will be prompted to download and install the package.  Once the ssh package is installed, you can use it either from the command line or directly from your workspace.  Unlike many utilities, I don’t usually use ssh from the command line.  I like visual file managers, so I like being able to use Nautilus to browse the files on the computer I’m connecting to.  To connect, I select “Connect to Server” from either my workspace or a nautilus window.  Then I enter the IP address of the computer I want to connect to.  This is information you can get via ifconfig on the computer in question, and will probably (depending on the size and topology of your network) be something like 192.168.1.xxx or 10.0.0.x, etc.  For “type” I select “SSH”; doing this automatically fills in the default port number of 22.  I leave the folder as root (/) and enter my username and password for the computer I’m connecting to.  I click “Connect”, and nautilus opens a window showing the file structure of the computer.  That’s it!  Now I can open and edit documents on the remote computer.

I’ve found this to be the easiest way to read and edit files on my desktop computer.  Certainly there are other ways, but if I use SSH to connect to my desktop, say, from my laptop in the living room, I can easily access everything I need, not just files I’ve put in a shared folder.  The method for connecting to your computer from outside your local network is more complicated and much more dangerous.  Typically if you’re going to try this you want to use keys instead of passwords and possibly also change the port used for SSH on the computer you’re connecting to.  I’ve never actually tried this, but it will be something I cover in a later post when I get around to working through the process.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: