Home > Information Technology > Using Your Shell Account

Using Your Shell Account

B2 Shells supports 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 idea to use that instead of regular telnet. However, you need a client that supports SSH, such as PuTTY or SecureCRT

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.

Simple SSH Commands.

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.

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).

gunzip – Extracts the contents of a gz file (which are similar to zip files), e.g. gunzip nice.tcl.gz.

kill -9 <pid> – 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.

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).

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 ax – 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.

pwd – Shows the current working directory path, e.g. /home2/user/cooldude/mybot.

quota – Shows how much disk space is allocated to you, and how much you’re using.

rm – Deletes a file. To delete a directory and all its contents (including subdirectories), use rm -rf .

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 ).

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.

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 [server] – 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 user@domain.com as your password).

ls – Lists the contents of the current directory on the FTP server.

cd [directory] – 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 [file1 file2 fileN] – 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.

bye – 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.

Share this article
Share on Facebook
Facebook
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin