Registration date : 01/01/1970
|Titulli: How to Use SHells Sat Nov 01, 2008 10:06 pm|| |
There are two programs you need in order to use your shell account - a telnet client and a FTP client. Telnet is used for performing commands on the shell, while FTP is used for transferring files between the shell and your computer. FileZilla is a popular, free FTP client. One freely available telnet program is PuTTYtel. Windows has a built-in telnet program, but it's quite crude.
Many shells support a secure telnet protocol called SSH (Secure SHell protocol). This works in basically the same way as telnet, but everything is encrypted for better security. If your shell supports SSH, it's a good to use that instead of regular telnet. However, you need a client that supports SSH, such as PuTTY.
When your shell account is activated, you should receive information which includes the hostname of the shell, and hostname of the FTP server (although the FTP server often has the same hostname as the shell). The first thing you'll want to do is telnet to the shell. Load up your telnet or SSH client, and enter the address of the shell (e.g. shell1.niceshells.net). You will be prompted for your username/password. After that, a motd will usually be displayed, and then you'll be staring at something that looks (and works) very similarly to a command prompt.
First up, you need to familiarise yourself with a few shell commands. Listed below are some of the commands you'll need to know to perform basic operations on the shell.
Working with files and directories
cd - Changes to the specified directory, similar to DOS's cd command. To switch to the directory above the current one, specify two periods as the directory, i.e. cd ... Typing cd ~ will return you to your home directory (the tilde is shorthand for the path your home directory, e.g. /home2/user/cooldude).
ls - This is very similar to the DOS dir command. It lists the contents of the current directory. For a more detailed listing, type ls -al.
mv - Renames a file or directory. You can also move a file with this command. For example, mv chatty.tcl scripts/chatty.tcl with move chatty.tcl to the scripts directory (relative to the current directory).
pwd - Shows the current working directory path, e.g. /home2/user/cooldude/mybot.
rm - Deletes a file. To delete a directory and all its contents (including subdirectories), use rm -rf .
bzip2 -d - Extracts the contents of a bz2 file (similar to gz files but with superior compression), e.g. bzip2 -d nice.tcl.gz.
gunzip - Extracts the contents of a gz file (which are similar to zip files), e.g. gunzip nice.tcl.gz.
tar -xf - Used to extract a tar file. To extract a tar.gz or .tgz file, use tar -zxf (if that doesn't work, use gunzip then tar -xf ). To extract a tar.bz2 file, use tar -jxf (if that doesn't work, use bzip2 -d then tar -xf ).
kill -9 - Kills the process with the specified pid number. You can get the pid number of a process by using the ps x command described below. This command is useful for killing your Eggdrop if you're unable to shut it down by other means.
passwd - Allows you to change your shell account password (it will prompt for your old password, then ask you to enter a new one).
pico -w - Opens the specified file in the pico text editor. The -w option prevents Tcl scripts from being messed up due to line wrapping.
ps x - Shows all current 'processes' you have running on the shell. This includes things such as Eggdrop, IRC bouncers, and open telnet and FTP sessions. This command is useful for getting the pid (process ID) number of a process. To view the resource usage of your processes, type ps ux.
The above commands are basically all you need to know in order to setup and run an Eggdrop. You may wish to learn some more commands as you become more experienced using the shell. Some other useful and interesting commands are shown below.
netstat - Displays all connections going to and from the server.
ps aux - Displays all processes running on the system and their resource usage.
quota - Shows how much disk space is allocated to you, and may show much you're using (if not, try du -s).
top - Displays details about system resource usage.
uptime - Displays the current uptime and server load.
vhosts - This will display a list of vhosts available for you to use (note that not all shells have this command).
Using FTP on the Shell
One of the most common uses for shell accounts is to download files from a server to the shell via FTP (note that this is different from transferring files between your machine and the shell via FTP). To do this, you connect to your shell account via telnet or SSH, and use the shell's FTP client. This works similarly to downloading files to your computer, but instead the file downloads to your space on the shell, and you can later download the file from the shell to your computer if needed. A fast shell is capable of downloading files at a much faster rate than a typical dial-up connection.
To download a file, type ftp at the shell prompt. You will then be greeted with the ftp prompt. Below is a list of the basic commands you need to use at the ftp prompt to download a file to your shell (shown in the order one would typically use them).
open - Connects to the specified FTP server. If the connection is successful, you'll be prompted to enter a login name and password (for most servers, type anonymous as login, and email@example.com as your password).
ls - Lists the contents of the current directory on the FTP server.
cd - Changes to the specified directory on the FTP server. To switch to the directory above the current one, specify two periods as the directory, i.e. cd ...
bin - Switches to binary mode. You need to use this command before you download any files.
hash - Enables the display of hash marks while downloading a file. Useful for monitoring download progress.
prompt - Disables prompting between gets if getting multiple files using mget (below).
get - Downloads the specified file to your shell.
mget - Downloads all specified files, one after the other. This command supports wildcards, e.g. mget egg* will download all files in the current directory on the FTP server with names starting with 'egg'.
close - Disconnects from the FTP server.
quit - Quits you from the ftp program.
As a final note, make sure you don't give out your shell password to anyone! Giving others access to your shell is asking for trouble. If you really want to give someone else access to your shell, make sure it's someone you trust and have known for a while, although doing even this may be against the shell provider's policy.