Archive for July, 2007

VNC (Free GotomyPC)

VNC produces a remote desktop window on any computer from any computer with a VNC server installed. The software consists of two components; a server and a remote (client). Install the server on the computer you want to remotely view (host), and then install the VNC Viewer (client) on any other machine on the internet. Installing the server on windows is simple a case of double clicking. The origional VNC software is RealVNC. On linux, most distributions will allow you to you install via apt. Open a terminal and type “sudo apt-get install vncserver”. You can also download the file from RealVNC.com; installation this way consists of unzipping the file, opening a terminal, type “cd ~/Desktop/UnzippedRealVNCFolder”, and to find the name of the unzipped Real VNC folder type “ls”. Now type “./configure”, then “make”, then “sudo make install”. After installation type “vncserver”, and it will prompt you for a password. This will be used by your VNC Viewer (client/remote) to login your you now running VNC Server. There is one major drawback of Real VNC server; it provides you a desktop other than the one displayed on your monitor. Linux is capable of multiple user logins. To serve the actual display, the one that is viewed on the monitor, you will have to use a different VNC server; x11vnc does exactly this. My next post will be about x11vnc, as it is different than Real VNC’s server. X11vnc startup requires manual operation, which can either be done locally on the server or remotely via ssh.

SSH Tunneling and Squid

Squid is a proxy server, which means that you can connect to the internet through it. Squid operates on port 3128, and requires two additional lines in the configuration file for it to work with a ssh tunneled port. In the squid configuration file type: acl anyname src localIP/255.255.255.0 http_access allow anyname ————————— By using the local ip address of the squid server, you will only be able to use the proxy server from the server ports itself. This works well with ssh port tunneling, because the tunnel makes the connection appear to come from the server itself. Now to access the squid server. Open a terminal and type: ssh IPofServer -L 3128:IPofServer:3128 This will allow you to connect to port 3128 on your remote machine, and it will be forwarded by the ssh tunnel to the corresponding port on the server. Now just go into your Firefox settings. Go to advanced, and then network connections. You want a manual proxy configuration to port to localhost and port 3128. Click ok, and bam, your internet connection will now be forwarded through an encrypted ssh tunnel to the squid server and then to the internet.

GUI SSH

Gnome is well integrated with ssh allowing you to make graphical connections to servers. If you are unfamiliar with the “scp” command, and want to make ssh connection graphically, go you your places menu and click connect to server. Select ssh, enter the information of the server, and bam, you now have a grahical ssh connection that will use nautilus to show you the folder on the ssh server that you connected to. You will have complete drag and drop capability, thus bypassing all command line requirements.

A Simple Move from Fedora Core 6 to Ubuntu Feisty Server

Its as simple as backing up your current files from the webserver. You should start with your html files and directories. Then I recommend your entire /etc directory just in case; you really only need your apache, ftp, php.ini, apache modules, and a few other things, but having the entire folder has come in handy in the past. Also if you use a mysql database backup /var/lib/mysql. The mysql folder contains all of your databased, and once your new server is up and running all you have to do is copy your based up mysql folder to its new home and bam, everything will work. Thats really all there is to it. Now install the new server software, and proceed to transfer your backed up files accordingly. I recommend ssh. With Ubuntu ssh is as easy as dragging and dropping files and folders. I will be using Ubuntu Feisty 7.04 Server, but there are a lot of other options to choose from. I have considered using another graphical desktop, which I am accustomed to with my current Fedora Core setup, but I feel the graphical interface is now unnecessary. Eliminating the graphical desktop should save substantial system resources, allowing my 900 MHz Pentium 3 perform optimally.

VNC through an Encrypted SSH Tunnel

Lets say you are away from home and want to access your home computers VNC server securely. Instead of directly connecting you can first create an ssh connection utilizing the tunnel feature. Creating a tunnel allows you to direct your VNC connection to your local 5900 port instead of the port on the server. Your local 5900 port is then transferred through the ssh connection, and then on the server is transferred to port 22 or whatever port you are using for ssh. The following is an example of creating a quick ssh connection with an associated port tunnel. Login to your ssh server as a user with the addition -L option. -L creates a port tunnel as shown: ssh user@serveripaddress -L 5900:serveripaddress:5900 Note that if you have a router an ssh connection, out-of-the-box, requires port 22. The ssh server listen port can be changed in the configuration file. The router must be configured to “forward” port 22 to the local ip address of the computer with the ssh server running. Now when you use xvncviewer, or any vncviewer just use localhost:5900 as the ip address to connect to and the connection will be transferred by the encrypted ssh tunnel.

SSH Quick and Dirty 3 Steps

Most linux distrubitons come preinstalled with an ssh client, and sometimes with a server. If you have two computers that you want to establish a secure connection between here are three simple steps form the perspective of no server being currently installed. Step 1: Install an ssh server either from a commonly available distribution on the internet, or in Ubuntu via apt. “sudo apt-get install ssh”. Step 2: Create a secure encryption key on your remote computer. “sudo ssh-keygen -t rsa”. Enter a password for added security, but you dont have to for easy ssh access. Step 3: Transfer the ssh encryption key to the server. You need the IP address of the server, which is either an external IP or a local IP if your behind a router. You also need a user to login to on the server. Bare in mind that all of these steps assumes that the server and remote are linux machines. “scp~/.ssh/id_rsa.pub anyone@192.168.0.6:.ssh/authorized_keys2″ Connecting from the remote machine to the server:  ssh-agent sh -c ‘ssh-add < /dev/null && ssh anyone@192.168.0.6′ Dont foget the trailing apostrophe. This will automatically open your secure encryption key, store it temporarily, connect to the ssh server, and use the store encryption key to verify the identity of the remote machine. Once verification is complete you will see the terminal windows of the user at the server that you just logged into from your remote machine.