Connect to a remote computer as if you are sitting in front of it

SSH is a method of remotely accessing a computer as if you were sitting in front of it. All the data between the two computers is sent encrypted and SSH is considered a very secure way of working. It's also very simple to use.

The steps required to install ssh and make a connection are as follows:

1. Start by using Synaptic to install openssh-server on the computer that you intend to connect to. This computer is known as the remote computer. The computer from which you intend to make the connection is known as the local computer. If it's running Ubuntu, or indeed almost any version of Linux (and also Mac OS X), it already has the software installed to connect to a remote computer.

2. Once the software is installed on the remote computer, on the local computer open a terminal window (or switch to a virtual console) and type the following:

$ ssh [email protected]

Obviously, you should replace username and address with the details specific to your setup. The username should be for an account on the remote computer. address can be an IP address or the fully-qualified domain name of the computer, if it has one—if you're

View technical details of PDF files just connecting across a local network then it's unlikely this will be the case.

For example, to connect as user keir on a computer with an IP address of 192.168.1.13, I would type the following: $ ssh kei [email protected]

If you need to find out the IP address of the remote computer, move over to it and right-click the NetworkMonitor icon. Then select Connection Information and, in the dialog box that appears, read the four sets of numbers alongside the IP Address heading.

3. Upon first connection you'll be warned that "the authenticity of the host can't be established". This is not an issue, so answer yes to the question of whether you want to carry on connecting. Following this you'll be prompted for the password of the user account you're logging into, so type it.

4. And then you'll be logged in to a standard shell session on the remote computer. Remember that the command-line prompt tells you the current username that you're logged in under, and also the name of the host that you're logged into.

When you've finished, just type exit to log out of the remote computer and end your SSH session.

You can even run graphical applications across an SSH connection. To do so, use the following command to connect to the remote computer: $ ssh -X [email protected]

Once connected, you can start any graphical application by typing its name. For example, to start Gedit, you would type gedit, as shown in Figure 3.32, on the following page. Always remember that, although the program appears on your computer, it's actually running on the remote computer. If you were to start OpenOffice.org Calc, and run complex calculations, the remote computer would be the one doing the number-crunching. It then tells the computer you're sitting in front of how to draw the program window.

An additional feature of SSH connections is that you can also transfer files. This is done using the SFTP command at the prompt, which is part of the larger SSH suite of software and which works much like the FTP command (see Tip 131, on page 173). You can also transfer files using Nautilus. Open a Nautilus window and click Go ^ Location. Then, in the Go To text field, type sftp://address, replacing address with the details

Figure 3.32: Running GUI applications across a remote connection (see Tip 190, on page 228)

you discovered earlier. You'll then be prompted for the username and password of the remote computer. Once entered, you'll be browsing the remote machine's files and can copy/delete files at will.

Was this article helpful?

0 0

Post a comment