Chapter 3: Connecting to Other Machines and Resources


One telephone all by itself is a fashion accessory; however, a telephone connected to a telecommunications network can be a lifesaver. In the same way, a computer sitting alone is certainly useful, but when you connect it to a network of other computers, magic happens. You can transfer data, access resources all over the world (or simply in the next room), print to machines not directly connected to your machine, control other computers, and even make Web pages available to anyone in the world. In many ways, the computing revolution over the last decade has really been about networking, and Knoppix makes the fruits of that revolution fully available to its users. Want to make resources on your box available to others using Knoppix? No problem. Want to use Knoppix to access network resources on other boxes? Even easier.

Understanding Remote Control

Sometimes you're sitting in front of one computer, but you really need to see what's happening on another. Maybe you're configuring one as a server and you need to test the other one as a client, or perhaps you're trying to help family members in another city solve a particularly knotty issue, and things would proceed far more smoothly if you could just see exactly what they're viewing. Knoppix makes remote control possible with two different, complementary apps: VNC and FreeNX.

Controlling Another Computer with Remote Desktop Connection

VNC is a free, versatile, multi-platform remote-control server and client that every computer user should have in his or her toolkit. First developed by researchers at the Olivetti & Oracle Research Lab, it was released under the GPL and made available to the world. VNC has received great acclaim because of its power and flexibility. It runs natively on Linux and other varieties of *nix, Windows and PocketPC, Mac OS, Palm OS, OS/2, and, best of all, virtually any machine that can run the alternative Java-based client software. Furthermore, clients running VNC on one OS can access and control any other OS running the server version of VNC. With VNC, you have powerful, free remote control at your fingertips.

Note 

For more about VNC, read the Wikipedia article at http://en.wikipedia.org/wiki/Vnc.

Knoppix doesn't come with a VNC client, but don't panic. Instead of a single-purpose VNC client, Knoppix comes with Remote Desktop Connection, which enables you to connect to both VNC servers and Windows servers running Remote Desktop Protocol (RDC). RDC is good software, and it comes with better features than most of the VNC clients, so this is a good move on the part of Knoppix.

Note 

Although this section focuses on VNC, you can use Remote Desktop Connection to connect to a Windows machine running RDP as well. Just enter rdp:/ in front of the IP address or domain name when you connect.

To start RDC via the GUI, open the K menu and select Internet Remote Desktop Connection, or enter krdc -caption %c %i %m on the command line. The Remote Desktop Connection dialog opens (see Figure 3-1).

image from book
Figure 3-1: Connect to other machines running VNC or RDP with Remote Desktop Connection.

This example connects to a VNC server, so enter the IP address or domain name in the Remote Desktop box, followed by a colon and the number of the VNC screen (probably 0, but if not, start incrementing by 1 until you hit the right number), and click the Connect button (to connect to a machine running VNC on my LAN, for instance, I enter 192.168.0.13:0 or chaucer:0 and click Connect). A second screen prompts you to choose your connection speed so that RDC can act accordingly.

RDC presents its options in a very clear fashion, so just pick the connection type appropriate to your network, click OK, enter the VNC server password in the resulting dialog box, click OK, and in a few seconds you're viewing another machine as though you were sitting right in front of it. You can do pretty much anything you want on the remote machine, within reason. Programs that involve a lot of screen redraws — such as games — are out of the question; I can't hear sounds played on Chaucer, and I can't transfer files back and forth between machines using VNC and RDC (for that, use FTP, SSH, or SMB, discussed later in this chapter). Within those limitations, however, you can still run an enormous gamut of programs, make configurations, and check up on what the remote machine is doing, all of which are invaluable tasks.

After RDC is open and running, you'll notice some controls (see Figure 3-2) at the top center of the window.

image from book
Figure 3-2: Controls at the top of the RDC window

Hold your mouse over any of those controls for a second or two and a tooltip appears, providing its name. Most of these controls are pretty explanatory, but the following two might come in particularly handy:

  • Autohide on/off (the pushpin): By default, the controls are always visible, so they can block your view of items at the top of the screen. This control toggles between autohide on, in which case the controls hide until you move your mouse to the top of the screen, and autohide off, the default.

  • Advanced options (the wrench): This actually contains two sub-options: View Only, which prevents your mouse from doing anything (good for watching demonstrations), and Always Show Local Cursor, which enables you to see both the cursor on the machine you've connected to and the cursor on your client machine.

Remote Desktop Connection is a powerful tool that is extremely helpful when you want to connect to a server running VNC or Remote Desktop Protocol, so make sure you get some practice using it.

Note 

For the latest KDE manual for Remote Desktop Connection, check out http://docs.kde.org/en/3.3/kdenetwork/krdc/index.html.

Exploring FreeNX

NoMachine (a division of Medialogic) created NoMachine NX, "a Terminal Server and remote access solution" based on the X Window protocol, but containing several improvements, including hyper-efficient compression (100:1 at the highest levels) and smart caching. In addition, NX can convert RDP (Remote Desktop Protocol, used by Microsoft Windows Terminal Services and Citrix MetaFrame) and RFB (Remote Frame Buffer, used by VNC) to NX, greatly improving the efficiency of those two protocols as well.

Note 

For more information about NoMachine and its NX software, head over to http://nomachine.com.

From a security perspective, NX has much to recommend it. It uses SSH (and the SSH daemon and its port) so that usernames and passwords are encrypted when connecting for the initial authentication. After you've passed that gauntlet and logged in, you can continue to use SSH so that all further traffic is also encrypted. If you're on your LAN and behind a firewall, you can disable session encryption for improved speed, especially with older hardware (we recommend continuing to use SSH unless you're using really old machines with slow CPUs, just to be as secure as possible).

NoMachine made its core technologies available under the GPL, and the result is FreeNX, a completely free implementation of the NX server and client. NoMachine completely supports the efforts of the FreeNX team by helping to ensure that both the free and commercial software remain in sync, which is to be commended.

Note 

An interview with two of the KDE developers who brought FreeNX to KDE can be found at http://www.osnews.com/printer.php?news_id=8139. Incredibly, FreeNX is actually just a BASH shell script — several hundred lines of a BASH script, but a BASH script nonetheless!

What kinds of machines can support the FreeNX server? For each KDE user session, you're looking at about 40MB of RAM and around 100MHz of your CPU, which ain't bad. With a good, fast machine, say around 3GHz with 1GB of RAM, you could support 25 parallel sessions or so. Again, that's not bad!

The net result of FreeNX: very fast, secure connections to other machines — and free to boot!

Setting Up FreeNX

To start the FreeNX server, select Knoppix Services Start NX Server. A dialog box opens, warning you that a new user named nxuser will be created who can access the FreeNX server. Go ahead and click OK. Another dialog box opens, prompting you to create a password for the new nxuser. To keep things simple for now, use nxuser as the password as well, and then click OK.

Caution 

Do not use nxuser as the password on your machine! Create a good password that will protect your machine and your data. For help in creating a good password, read the SecurityFocus column titled "Pass the Chocolate," available at http://www.securityfocus.com/columnists/245.

FreeNX generates encryption keys so that all communications sent using its protocols are safe from packet sniffers; it spawns a shell window in which you can watch the process.

Meanwhile, another dialog box opens, informing you that it's now possible to log in using the newly created nxuser account. Note that you can log in as any user already on the system, so the user knoppix — who has no password set by default, remember — can also log in. When you click OK to close the dialog box, the shell window spawned by FreeNX also disappears, and FreeNX is up and running.

image from book
Command-Line Controls for FreeNX Server

It's pretty easy to change the FreeNX server by using the command line. Once you're running as root (just type su - on the command line, press Enter, and you're running as the superuser), you can enter any of the commands following to make alterations:

  • nxserver -listuser: Displays a list of FreeNX users, which could be very helpful if you want to verify just who can log in to your machine

  • nxserver -adduser username: Adds a new user, which you probably won't need to do because nxuser is sufficient

  • nxserver -deluser username: Deletes a user

  • nxserver -passwd username: Prompts you for a new password for the specified user, which again probably won't need to be done, assuming you picked an adequate password for nxuser when you were originally prompted

  • nxserver -status: Is FreeNX server running? Find out with this command.

  • nxserver -start: Starts the FreeNX server if it's not running

  • nxserver -stop: Stops the FreeNX server if it is running

  • nxserver -restart: If the FreeNX server is running, restart it; if it's not running, start it. Be forewarned: Anyone connected to your FreeNX server when you run this command is going to be rudely disconnected, unless you use the next command.

  • nxserver -broadcast message: Sends your message to all logged-in users, which you should do before restarting the server

For the full list of possible options, just type nxserver on the command line as root and press Enter.

image from book



Hacking Knoppix
Hacking Knoppix (ExtremeTech)
ISBN: 0764597841
EAN: 2147483647
Year: 2007
Pages: 118

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net