Simple SSH Installation
SSH (Secure Shell) is a protocol that is used to remotely connect to another computer running an SSH server. The standard interface is a simple command line, although you can also run graphical (X11) applications on a Linux or BSD server. Below, we will cover setting up a client, server, and connecting the two.
Written by Rob Kerfia
Setting up a server
1 Launch Synaptic (or Adept if you use Kubuntu) System > Administration > Synaptic Package Manager and enter your password.
2 Search for the "openssh-server" package and click on the empty checkbox. Choose "Mark for Installation" from the menu.
3 Repeat the above step for the package "inadyn". (This will come in handy later.)
4 When asked "Apply the following changes?", click Apply.
5 The package should install. Click "Close" and quit Synaptic.
Now you have a server installed! You might be wondering what you can do with it. Well, you can do a lot of things - from remote file transfers to running applications on your computer from another one. Before you can do that, though, there are a few more steps. First, you have to know how to connect to your computer remotely. First let's set up a dynamic DNS account so you can access your computer via an easy to remember subdomain, not a lengthy IP address.
1. Go to www.dyndns.com and click "Create Account" underneath the login box at the top of the page.
2. Choose a username, password, and all the rest of that nice stuff.
3. Confirm your account with the email they sent you and log in.
4. Click the "My Services" link and choose "Add New Hostname" on the new page that comes up.
5. Choose a hostname, subdomain, and click the auto-detected remote IP link underneath the "IP Address" field. Click "Create New Host".
6. Next, go to your terminal and type:
gksudo gedit /etc/crontab
press Enter and then type in your password.
7. Type in
0 * * * * inadyn -u your_username -p your_password -a name.you.registered > /dev/null
all on one line. I can't stress this enough - don't delete or change anything else.
8. Save and quit.
9. You should be able to access your computer via the domain you registered in about an hour.
To connect to your computer, simply type in:
ssh [username]@[registered.subdomain]
from a terminal. The first time you connect from a particular machine, you might get a message saying "The authenticity of host [subdomain] (IP address) can't be established." You can safely ignore this - type "yes." Next, you should be prompted for a password. If you enter that correctly, you should be at a command line prompt - on your computer!
Some neat tricks you can use with SSH:
Run graphical applications
Type:
ssh -X username@subdomain
at a terminal. Enter your password like normal. Now, type in the name of a graphical application at the command prompt (like "nautilus" or "thunar"). It should show up on the computer you're at, except it's running on your computer.
Copy files
Type:
scp username@subdomain:/path/to/file username_for_comp_you're_at@localhost:~/
and this will copy the file into your home folder.