Archive for April, 2008

Web hosting unlimited bandwidth - 490 CHAPTER 34 ACCESSING COMPUTERS REMOTELY Of

Wednesday, April 30th, 2008

490 CHAPTER 34 ACCESSING COMPUTERS REMOTELY Of course, the XP computer will need be configured to allow incoming RDP connections. To configure it, right-click My Computer, selecting Properties, click the Remote tab, and make sure Allow Users to Connect Remotely to This Computer is checked, as shown in Figure 34-4. The Windows computer to which you want to connect may also need to be updated with the latest service packs, particularly in the case of a Windows 2000 computer. Figure 34-4. You can access remote Windows XP Professional machines using RDP and the Terminal Server Client program. If this is the first time you ve accessed the Windows computer over an RDP connection, you might be wondering why the graphics look so bad. This is because they re heavily compressed in order to transmit efficiently across networks.

CHAPTER 34 ACCESSING COMPUTERS REMOTELY Note Ignore (Web hosting ratings)

Tuesday, April 29th, 2008

CHAPTER 34 ACCESSING COMPUTERS REMOTELY Note Ignore the information in the dialog box about how users can view your desktop, because the address it gives is wrong. Instead, you should find out your computer s IP address and use that. To do this, click Applications . System Tools . Network Tools. Ensure your network device is selected in the drop- down list and look for the IPv4 IP address in the list. 2. On the computer from which you want to connect to the remote desktop, click Applications . Internet . Terminal Server Client. In the Computer field, enter the IP address of the computer you wish to connect to. In the Protocol drop-down list, select VNC. Then click Connect. 3. You ll be prompted to enter the password, if one is applicable, and you should then see the remote computer s desktop in a window. Once you ve finished, simply close the window to terminate the connection. Connecting to Remote Windows Computers The Terminal Server Client program allows you to connect to a variety of remote desktop server programs and, in particular, Windows XP or Windows 2000 computers via the Remote Desktop Protocol (RDP). Unfortunately, Windows XP Home, Me, 98, and 95 don t support RDP connections, which means that they aren t able to run an RDP server and allow other computers to access their desktops. However, there is a way to access the desktop of these computers remotely using some add-in software. Connecting to Windows XP Professional, 2000, and NT Using Terminal Server Client to access a Windows XP Professional, 2000, or NT computer is easy. Here, I use an XP Professional machine as an example, but the instructions are valid for 2000 and NT, too. You ll find the Terminal Server Client program on the Applications . Internet menu. Once it s running, in the Computer field, type either the IP address of the machine or its FQDN (if applicable). You don t need to type the username, password, or any other details. Click Connect, and a new window should appear in which you should see an XP login prompt. You should then log in to Windows using your username and password. Caution If you haven t set a password for your user account on the Windows machine, you won t be able to log in. This is a quirk of the Windows XP RDP system. The solution is simple: use the User Accounts applet within the Windows Control Panel to assign yourself a password.

488 CHAPTER 34 ACCESSING COMPUTERS REMOTELY Accessing (Make a web site)

Monday, April 28th, 2008

488 CHAPTER 34 ACCESSING COMPUTERS REMOTELY Accessing Ubuntu via Remote Desktop A less secure but more convenient way to access your PC s desktop across a network is to use Ubuntu s Remote Desktop feature. The advantage of this method is that the desktop of the remote computer appears in a window on the remote computer s desktop, so there s no need to kill the existing X server and start a new one. Remote Desktop uses the Virtual Network Computing (VNC) software to share the desktop. Sharing is the key word because, effectively, anyone who connects will take control of the main desktop. They will control the mouse and keyboard input. However, there are a couple of important differences compared to accessing X across an ssh connection: Although the password is sent encrypted, the rest of the VNC data transfers aren t. Complete encryption is possible using special versions of VNC, or via an OpenSSH tunnel, but this can be difficult to set up on the Windows end of the connection. The remote desktop isn t blanked, so anyone standing in front of the computer will be able to see what you re doing. This could present a security/privacy risk. If you re prepared to put up with these caveats, then allowing remote desktop access on a computer is easy. Here s the procedure: 1. Click System . Preferences and then click Remote Desktop. Put a check alongside Allow Other Users to View Your Desktop and ensure there s a check in the box alongside Allow Other Users to Control Your Desktop, as shown in Figure 34-3. Beneath this option, you can choose whether the user can confirm each connection and whether you want to set a password. Both options add to the security of your system, although the confirmation option will mean that someone will have to be at the computer to authorize an incoming connection. Figure 34-3. Ubuntu s Remote Desktop feature lets you share your desktop but isn t as secure as making an X server connection across SSH.

CHAPTER 34 ACCESSING (Web host forum) COMPUTERS REMOTELY On the

Saturday, April 26th, 2008

CHAPTER 34 ACCESSING COMPUTERS REMOTELY On the local machine from which you would like to initiate the connection, close all open programs and then kill the X server by pressing Ctrl+Backspace. If you find the GUI restarts, press Ctrl+Backspace again. Log in at the command prompt and then type: xinit This will start a rudimentary X session, complete with an xtermshell window. You can then use the ssh command to log in to your remote machine, specifying that X communications should be allowed over the connection: ssh -X @ And then type the following: gnome-session After a few seconds, the remote computer s GNOME desktop will appear. Make sure you don t close the original xtermwindow, because this owns the gnome-sessionprocess, so closing it would kill the desktop. Once again, the remote desktop will be fairly slow to respond to mouse clicks and keyboard strokes, but it should be usable. If you intend to do this often, you may wish to configure a command-line only run level on the local machine. This will mean you boot to a non-GUI login prompt and can then initiate your own X session manually (either running GNOME on your local machine or on a remote machine). Most Linux distributions, such as Red Hat or SUSE, define run level 3 as command- line only, so you can do the same. Note Under Ubuntu, run levels 2 through 5 are exactly the same. Run level 2 is used all the time, and run levels 3 through 5 are effectively spares that can be altered however you wish. Type the following to stop the GUI starting automatically under run level 3: sudo rm f /etc/rc3.d/S13gdm Following this, you ll need to modify the /etc/inittab file so that you boot to the modified run level 3. The following will load it into the Gedit text editor: sudo gedit /etc/inittab Look for the line that begins id:2:initdefault: and change it so it reads id:3:initdefault:. Then save the file and reboot. Once you ve logged in, you ll have the choice of either starting the X server shell for a remote connection, as described earlier, or starting the usual GNOME desktop on the local machine by typing startx.

Web hosting isp - 486 CHAPTER 34 ACCESSING COMPUTERS REMOTELY Figure

Saturday, April 26th, 2008

486 CHAPTER 34 ACCESSING COMPUTERS REMOTELY Figure 34-2. Although the calculator application appears on the local computer s display, it s actually running on the remote machine. Using X across the Internet or even a local network isn t very fast, and you can expect delays when you open menus or if the screen must frequently redraw. However, it can prove very useful. Running the GNOME Desktop Across a Remote Connection It s even possible to run the entire GNOME desktop across an ssh connection. In other words, you can access the desktop of a remote computer as if you were sitting in front of it. You can do this by starting a stripped-down X server shell on the local computer, and then initiating the GNOME desktop on the remote computer via an ssh connection. Note If the remote computer is already running a desktop, yours will run in addition to it. Anyone using the remote computer won t be aware of what you re doing, unless they specifically look for evidence. However, sound isn t part of what X takes care of, so any sounds normally made during GNOME startup, such as the jingle, will be heard on the remote machine! The same applies for any error noises, such as beeps.

CHAPTER 34 ACCESSING COMPUTERS REMOTELY 485 (Ecommerce web host) Table

Friday, April 25th, 2008

CHAPTER 34 ACCESSING COMPUTERS REMOTELY 485 Table 34-1. sftp Commands Command Function put Upload the specified file to the remote machine pwd Print the current remote directory rmdir Delete the remote directory rm Delete the remote file exit Quit sftp !command Execute the specified command on the local machine ! Start a temporary local shell session (type exit to return to sftp) help Show a list of commands Accessing GUI Applications Remotely So far, we ve looked at connecting to a remote machine using command-line tools. But Ubuntu is based around the graphical desktop, so is there any way of running, say, a Nautilus file browser window so you can manipulate files on the remote machine? Yes! The graphical subsystem of Linux, X, is designed to work across a network. In fact, if you run Linux on your desktop PC, X still works via a loopback network within your machine (meaning that network commands are sent out but addressed to the very same machine on which they originated). Because of this, it s possible to make programs on a remote machine run on a local machine s X server. The actual work of running the application is handled by the remote machine, but the work of displaying the graphics is handled by the local machine. Caution X connections across a network can be a little slow and certainly not as snappy as running the same application on the local machine. This lag can become irritating after a while. Running X Applications on a Remote Computer Unfortunately, X server communications aren t normally encrypted, so if one machine were to simply connect to an X server over a network (or even the Internet), the data transfer would be unencrypted and open to eavesdroppers. But ssh once again comes to the rescue. You can configure ssh so that X applications on the remote computer can be run on the local machine, with the data sent through the ssh connection. Log in to the remote machine using ssh, but also specify the -X flag: ssh X @ When you re logged in, you can simply start any application by typing its name as usual. The only difference is that the program will appear on the screen of the local machine, rather than on the remote machine, as shown in Figure 34-2.

484 CHAPTER 34 ACCESSING COMPUTERS REMOTELY Using (Affordable web design)

Thursday, April 24th, 2008

484 CHAPTER 34 ACCESSING COMPUTERS REMOTELY Using sftp To copy a lot of files to or from a remote computer, the sftpprogram is the best solution. If you ve ever used a shell-based ftp program, you ll feel right at home, because sftp isn t very different. The difference compared to scp is that you use sftp to establish a connection with the remote computer in a similar way to ssh, except you can use only certain commands. You can initiate a sftp session by using this command format: sftp @ The same rules as when you re logging in with ssh apply, both in terms of formatting the login command and also confirming the encryption key if this is the first time you ve logged in. The sftp commands are fairly basic. For example, to copy a file from the remote machine, simply type this: get This will copy the file into the directory you were in on the local machine before you started the sftp session. By specifying a path after the filename, the file will be copied to the specified local directory: get spreadsheet.xls /home/keir/downloaded_files/ Sending files from the local machine to the remote machine is just as easy: put By specifying a path after the filename, you can ensure the file is saved to a particular remote path. One useful thing to remember is that any command preceded by an exclamation mark (!, called a bang in Linux-speak) is executed on the local machine as a shell command. So, if you wanted to remove a file on the local machine, you could type this: !rm -rf Simply typing a bang symbol on its own starts a shell session on the local machine, so you can perform even more tasks. When you re finished, type exit to return to the sftp program. For a list of popular sftp commands, see Table 34-1. Table 34-1. sftp Commands Command Function cd Change the remote directory lcd Change the local directory get Download the specified file ls List the remote directory lls List the local directory mkdir Create a directory on the remote machine lmkdir Create a directory on the local machine

CHAPTER 34 ACCESSING COMPUTERS REMOTELY Transferring Files (Web hosting providers)

Wednesday, April 23rd, 2008

CHAPTER 34 ACCESSING COMPUTERS REMOTELY Transferring Files Between Remote Computers The ssh utility brings with it two basic ways of transferring files between machines: scp and sftp. scp is fine for smaller file transfers, but if you want to copy a lot of files, sftp is probably a better choice. Using scp Strictly speaking, scp is merely a program that copies files from one computer to another in a secure fashion using the underlying ssh protocol. You don t have to be logged in to another computer via ssh to use it. For example, if I were merely browsing my own computer and wanted to transfer a file to a remote computer, I could type: scp myfile keir@:/home/keir/ I would replace with the IP address of the computer to which I wanted to send the file. In other words, you must first specify the local file you want to copy across, and then provide the login details for the remote computer in the same format as with an ssh login. Then, after a colon, you specify the path on the remote computer where you would like the file to be copied. Note If it helps, consider the latter part of the scpcommand after the filename as one large address: first you provide your username, then the computer address, and then the path. Using the command when you are logged in to another computer via ssh works in exactly the same way. Let s consider an example. Assume there are two computers: A and B. I have a user account on each one. So sitting at the keyboard of A, I establish an ssh connection with B by typing the following: ssh keir@computer_B This lets me log in to B as if I were sitting in front of it. I spot a file called spreadsheet.xls that I want to copy to my local machine (A). I therefore issue the following command: scp spreadsheet.xls keir@computer_A:/home/keir/ This will copy the file from computer B to computer A and place it in the /home/keir/ directory. Tip With scp, you can copy entire directories, too. Simply add the -r command option, like so: scp -r mydirectory @:/path/.

482 CHAPTER 34 ACCESSING (X web hosting) COMPUTERS REMOTELY her

Wednesday, April 23rd, 2008

482 CHAPTER 34 ACCESSING COMPUTERS REMOTELY her network connections using something similar to the netstat command, then she would see another computer attached via ssh. To end an ssh session, simply type exit. This will then return you to the command prompt on your own machine. Tip There s a version of the ssh client that runs on a variety of non-Linux operating systems, making it possible to log in to your Ubuntu machine from a Windows computer. The program is called PuTTY and can be downloaded from www.chiark.greenend.org.uk/~sgtatham/putty/. MANAGING REMOTE SESSIONS Whenever you open any kind of shell to enter commands and run programs, you might have noticed that any commands you start running last only as long as the shell window is open. When the shell window is closed, any task running within it ends, too. This is because the shell is seen as the owner of the process, and when the owner dies, any processes it started also die. When using ssh to start a remote shell session, this also applies. Whenever you log out, any tasks you were running are ended. This can be annoying if, for example, you ve started a lengthy download on the remote machine. Effectively, you must remain logged in via ssh until the download has finished. To get around this, you can use the handy screen program. This isn t specifically designed to be an aid to remote logins, but there s no reason why it cannot be used in such a situation. The screen program effectively starts shell sessions that stick around, even if the shell window is closed or the ssh connection is ended or lost. After logging in to the remote computer via ssh, you can start a screen session by simply typing the program name at the prompt: screen After pressing the spacebar as prompted to start the program, there won t be any indication that you re running a screen session. There s no taskbar at the bottom of the terminal window, for example. screen works completely in the background. Let s consider what happens when you detach and then reattach to a screen session. To detach from the screen session, press Ctrl+A and then Ctrl+D. You ll then be returned to the standard shell and, in fact, you could now disconnect from your ssh session as usual. However, the screen session will still be running in the background on the remote computer. To prove this, you could log back in, and then type this: screen -r This will resume your screen session, and you should be able to pick up quite literally where you left off; any output from previous commands will be displayed. To quit a screen session, you can either type exit from within it or press Ctrl+A, and then Ctrl+ (backslash). The screen program is very powerful. To learn more about it, read its man page. To see a list of its keyboard commands, press Ctrl+A, and then type a question mark (?) while screen is running.

CHAPTER 34 (Web hosting service) ACCESSING COMPUTERS REMOTELY 481 The

Tuesday, April 22nd, 2008

CHAPTER 34 ACCESSING COMPUTERS REMOTELY 481 The authenticity of the host can’t be established Figure 34-1 shows an example. This means that the remote computer s encryption key hasn t yet been added to your PC s store file. However, once you agree to the initial login, the encryption key will be added, and it will be used in the future to confirm that the remote computer you re connecting to is authentic. Figure 34-1. When logging in via ssh for the first time, you ll need to confirm acceptance of the encryption key. Note There s a fine line between security concern and paranoia. Connecting to a remote machine for the first time and accepting its ssh key is considered insecure by some people, because you cannot be 100% sure that the remote machine is the one you want to connect to. It might have been swapped for a different machine by hackers (or some such theory). In addition, the key might be intercepted on its journey to you. Because of this, those who are highly security conscious can use the ssh-keygen program to create a key on the remote machine first, and then import it to the local machine via floppy disk before logging in. See the ssh-keygen man page for more details. After confirming that you want to make the connection, you ll be invited to enter the password for the user account under which you initiated the ssh connection. Once this is done, you should find yourself with a shell login on the remote computer. You can run the same commands as usual and perform identical tasks. The machine you re logged in to will show no symptoms of being used remotely. This isn t like the movies, where what you type on your local machine is somehow mirrored on the remote machine for all to see. However, obviously, if a user of the remote machine were to view