Connecting to your Linux server via SSH

General

A Telnet SSH (Secure Shell) session is a useful means of direct communication with your Virtual Server. One popular use is for changing the permission settings for CGI scripts, and it can also be used to test scripts and generally manage your web site(s).

In the interests of maintaining security of users' accounts, the use of conventional Telnet has been discontinued and access is available only by using Secure Shell (SSH) access.

Telnet SSH Software

A number of suitable Telnet SSH clients are available for download from the web, at prices ranging from free to above US$100. Here are three for Windows:

* - 30-day free trial available

If you are using Apple OS X, please refer to this guide for instructions on how to set up SSH on your computer.

Using Telnet SSH

Connecting to the server is quite straightforward. You will need the following information to be able to connect:

  • Your domain or sub-domain name
  • Your username
  • Your password

Log in to your account according to the particular software you are using. This will log you into the root directory of your virtual server - /home/MainDomainUsername/yourdomain.co.uk/ .

The screen will display much like the almost-forgotten DOS screen that us old'uns used to suffer. You can type commands and the server will respond as if you were sitting at that computer. The main difference is that you are working with a Unix-type server, so the commands are Unix and not DOS, although many are similar.

Basic Unix Commands

Unix has a large range of commands, which can be used through a Telnet SSH session. The full use and function of these is outside the scope of this support file, but some useful commands are as follows:

apropos command
man command
A useful help command that will give you the possible syntax option for a given command
catDisplay contents of file
cd directoryChange directory
chmod nnn filename
chmod nnn directory
Set permissions for a file or directory. nnn represents three numbers according to the permissions required. The three figures specify permissions for the "Owner", "Group" and "World". Appropriate digits are 0 (nothing), 4 (read), 5 (read/execute), 6 (write/read) and 7 (execute/write/read) Thus a data file that a script writes to (but is not viewed on the web) should be set to 600, whilst one that is written to by a script, but read on the web (such as a guest book) should be set to 644.
cp filename locationCopy file
dateDisplay date and time
dfDisplay free disc space
diff filename filenameCompare files
fgrep filename
grep filename
Find string in file
ls
ls -l
ls -la
Directory listing (in differing layouts)
mkdir directoryCreate directory
more filenameDisplay file with pauses at each screenful
mv filename locationMove or rename file
pwdWhat is current working directory?
rm filenameDelete file
rmdir directoryDelete directory
pico filenameEdit file. A simple text editor, useful for directly editing CGI scripts without having to download/upload them. You exit Pico using Ctrl-X. "Save modified buffer" means Save File to you or I! You can save it under the same file name or a new one.
./scriptnameExecute script. This is useful for testing scripts as it will identify any faults rather than just giving the Internal Server Error message that is seen if you access it though a web browser. To execute scripts in this manner, your permissions must be set to allow you (the "user") to run them.


  • SSH
  • 0 utilizatori au considerat informația utilă
Răspunsul a fost util?