Quality web hosting and ecommerce solutions web hosting,webhosting,unlimited web site hosting,web hosting services,cheap web hosting,reseller web hosting,domain host,best web hosting, business hosting, Ecommerce web hosting,best web host,webhosting
Online Ecommerce and business solutions
Providing high quality web hosting and ecommerce solutions for businesses and individuals around the world.
Magicz Web Hosting



Webhosting



Ecommerce









What is SSH?
SSH clients we recommend for use.
Connecting to Magicz servers through SSH2.
Basic SSH commands for beginners.
Using PICO in a shell session.
Talking to other users in SSH.
Debugging your CGI scripts through SSH.





What is SSH?

SSH is a secure protocol most often used to connect to a UNIX system because of its command line interface. SSH is a very useful protocol when properly used but lacks a graphical user interface. It has a number of advantages over FTP, including the availibility to chat with users, pinpoint problems in CGI scripts, delete directories if they are not empty, and editing of files without downloading them from the server.
Back to the top.




SSH clients we recommend for use.

We reccommend a program called SecureCRT by VanDyke Technologies. You can download SecureCRT from VanDyke Technologies.
There is also a free SSH client called Putty available at http://www.chiark.greenend.org.uk/~sgtatham/putty/
Back to the top.




Connecting to Magicz servers through SSH2.

Connecting to Magicz servers via SSH2 is simple. Use your domain name or your IP address as the hostname. In the SSH2 window of SecureCRT, you will then be prompted for your login and password. Once you enter this information and the server verifies this information, you will be logged into the root (/home/your_login) of your account. Back to the top.




Basic SSH commands for beginners.

SSH comes with a large number of commands that cannot all be discussed in this brief tutorial. Below we attempt to address basic shell commands.

ls
This command will list all of the files and directories within the current directory.

cd
This command will change your current directory to the directroy you specify. An example would be that "cd public_html" would take you into your public_html directory.

mv
This command will move a file from its current location within the current directory to the directory you specify. For example, lets say you are in your public_html directory and you want to move the file "links.cgi" into your "cgi-local" directory. At the prompt type "mv links.cgi cgi-local.

chmod XXX
This command will set the permissions on a file or directory to whatever you specify. The "XXX" would be replaced by actual numbers, such as 644. For example, if we wanted to set the permissions on our links.cgi file in our cgi-local directory, we would first go into that directory then type "chmod 755 links.cgi" at the prompt.

rm
This command will delete the filename or directory you specify in the current directory. If we wanted to remove the directory named "user", we would type "rm user" at the prompt.

man
This is one of the most helpful commands for new users. It allows you to see all of the different options for a particular command. For example, if were were to type "man ls", we would then see all of the different options available for the list (ls) command.

traceroute
This command will perform a traceroute on a particular virtual domain to see how many hops it takes to get from your location to the domain specified. An example would be "traceroute yahoo.com", which would show us how long it takes for packets to get to yahoo.com and how they get there.

whois
This command will display the current InterNIC record including administrative, technical, and billing contact for a particular domain if it is already owned.
Back to the top.




Using PICO in SSH.

Pico is a very basic editor used in SSH. Although basic, it is very useful in that you can edit your HTML files, CGI scripts, and any other ASCII files, without downloading them from the server, making the changes, then uploading them again. Pico is used in the following manner: type in "pico " at the prompt. For example, lets say we wanted to edit a line in our links.cgi file. We would need to get into the directory where that file resides and type in "pico links.cgi" at the prompt. Now a screen would appear with our links.cgi file. Once you are finished making the changes to a file, press at the same time. Pico will ask you if you wish to "Save modified buffer" (in plain English, save the changes). Type "y" if you want the changes saved or "n" if you want the changes ignored. If you typed in "y" it will then ask you "File name to write:", which means the file name to save the changes to; the default value is the file we originally edited (in this case, links.cgi). So you can save the changed file to a different name if you wish. For more information on Pico, visit the following URL: http://www-scf.usc.edu/~ellars/pico.html
Back to the top.




Talking to other users in SSH.

To talk to any user on the system, just type "talk login" where login is the acutal login of the user you want to talk to. If the user accepts you chat request, a divided screen will appear and you two will be able to chat.
Back to the top.




Debugging your CGI scripts through SSH.

One of the most powerful features of shell is that you can pinpoint problems in your CGI scripts. Unlike the HTTPD protocol which displays the infamous "Internal Server Error" message, SSH will tell you what the real problem is!
To test your script, you must execute it on the server which means your permissions must allow you (the user) to execute the script. Otherwise, a permission denied message will occur. SSH into the directory where the script you wish to test resides. Lets say that the CGI script named "links.cgi" is giving us problems!
To find the problem, type in "./links.cgi". The server will then execute the script and tell you what, if any, problems occur. The syntax for this command is "./script_name". After you have found the problem, you can edit your CGI script using PICO in SSH, then test it again. Eventually you will get your script working, and much faster than trying to pinpoint the problem yourself!
Note: 95% of the time, the problem is either the permissions on the script(s) are not properly set or the scripts(s) varible(s) are not properly set.
Back to the top.

Copyright © 1998-2006 Magicz.com. All Rights Reserved. Please see our Acceptable Use Policy and our Privacy Policy.
If you have any questions or comments contact info@magicz.com
web hosting, webhosting, web site hosting, ecommerce, web hosting services, cheap web hosting, reseller web hosting, domain host, ecommerce host, web page hosting, best web hosting, business hosting, Ecommerce web hosting, cheap webhosting, web hosting services, cheap web site hosting, affordable web hosting, business web hosting, best web hosting, small business web hosting