Ssh & scp
Windows 2000

General Info

Roving Profile
Exam Papers

System Support


SSH (Secure Shell)

SSH is used for logging in to a multi-user computer from another computer, over a network. It provides an encrypted terminal session with strong authentication of both the server and client, using public-key cryptography.Multi-user computer systems, such as Linux and Unix, usually present a command-line interface to the user, similar to the 'Command Prompt' in Windows NT. The system types a prompt, and you type commands which the system will obey. Using this type of interface, there is no need to be sitting at the same machine you are typing commands to. The commands, and responses, can be sent over a network, so you can sit at one computer and give commands to another one, or even to more than one. SSH is a network protocol that allows you to do this. On the computer you sit at, you run a client, which makes a network connection to the other computer (i.e. the server). The network connection carries your keystrokes and commands from the client to the server, and carries the server's responses back to you. You would use SSH if you have an account on a Linux or Unix system which you want to be able to access from somewhere else.You won't need SSH if you only use windows. SSH features include:

A variety of user authentication measures.
Secure file transfers.
Tunneling TCP connections through the SSH session

SCP (Secure Copy)

SCP is a remote file copy program used for copying files over the network securely. It uses SSH for data transfer, and uses the same authentication and provides the same security as SSH. Any file name may contain a host and user specification to indicate that the file is to be copied to/from that host. Copies between two remote hosts are permitted.

SCP: Copying files from one machine to another

Use SCP to copy files from one machine to another. SCP replaces rcp, should be used instead of ftp. It also has more flexibility than ftp and can be use to copy directories instead of just files. The general form of SCP is:

scp [[user@]host1:]filename1 [[user@]host2:]filename2

Where filename1 and filename2 can be file or directory names. If your user name is the same on both the local and remote machines, then you do not have to provide user@ name. If you are copying from your local machine, you do not have to provide the name of host1. For example, to copy a file called from a local machine to, use the following command:


The file will be copied to your home directory on i7. If you have a different user name on i7, then specify it as shown below:



This is a feature of the SSH protocol. It is designed to protect you against a network attack known as spoofing: secretly redirecting your connection to a different computer, so that you send your password to the wrong machine. Using this technique, an attacker would be able to learn the password that guards your login account, and could then log in as if they were you and use the account for their own purposes. To prevent this attack, each server has a unique identifying code, called a host key. These keys are created in a way that prevents one server from forging another server's key. So if you connect to a server and it sends you a different host key from the one you were expecting, PuTTY can warn you that the server may have been switched and that a spoofing attack might be in progress. PuTTY records the host key for each server you connect to, in the Windows Registry. Every time you connect to a server, it checks that the host key presented by the server is the same host key as it was the last time you connected. If it is not, you will see a warning, and you will have the chance to abandon your connection before you type any private information (such as a password) into it. However, when you connect to a server you have not connected to before, PuTTY has no way of telling whether the host key is the right one or not. So it gives a warning, and asks you whether you want to trust this host key or not.

Logging In

After you have connected, and perhaps verified the server's host key, you will be asked to log in, probably using a username and a password. Your system administrator should have provided you with these. Enter the username and the password, and the server should grant you access and begin your session. If you have mistyped your password, most servers will give you several chances to get it right. If you are using SSH, be careful not to type your username incorrectly, because you will not have a chance to correct it after you press Return. This is an unfortunate feature of the SSH protocol: it does not allow you to make two login attempts using different usernames. If you type your username wrongly, you must close PuTTY and start again. If your password is refused but you are sure you have typed it correctly, check that Caps Lock is not enabled. Many login servers, particularly Unix computers, treat upper case and lower case as different when checking your password; so if Caps Lock is on, your password will probably be refused.

After Logging In

After you log in to the server, what happens next is up to the server! Most servers will print some sort of login message and then present a prompt, at which you can type commands which the server will carry out. Some servers will offer you on-line help; others might not. If you are in doubt about what to do next, consult your system administrator.

Logging Out

When you have finished your session, you should log out by typing the server's own logout command. This might vary between servers; if in doubt, try `logout' or `exit', or consult a manual or your system administrator. When the server processes your logout command, the PuTTY window should close itself automatically. You can close a PuTTY session using the Close button in the window border, but this might confuse the server - a bit like hanging up a telephone unexpectedly in the middle of a conversation. We recommend you do not do this unless the server has stopped responding to you and you cannot close the window any other way.

Department of computer science and information systems
University of limerick, limerick, Eire

Department of Computer Science and Information Systems, University of Limerick, Limerick, Rep of Ireland
Valid HTML 4.01! Valid CSS!