www.ntnu.no *
INFOWEB >  newbie >  getting started  > FTP how-to
Verktøy
Du kan legge til kommentarer
Eller sende denne artikkelen
Les artikler skrevet av livermor
Brukervurdering
Hvor mye hjelp var det i denne artikkelen?
Mye Noe Lite
Forhåndsvisning
Du trenger ikke en 'utskriftsvennlig side' for å skrive ut denne siden. Forklaring
Innhold

FTP how-to

Outdated information

As FTP transmits your password in clear text, this is not in use at NTNU. System Management has decided to use sftp instead. You can read more about this here.

What is FTP?

FTP, File Transfer Protocol, is a protocol used for exchanging files over networks that support TCP/IP, like the Internet.

To use FTP you need an FTP-client. There are various FTP-clients around, and most of today's web browsers have one. In all versions of Windows and most *nix-installations you get a text-based one, although those with graphical interface are more commonly used.

Anonymous and non-anonymous FTP and access to your home directory

There are two different ways of connecting to an FTP-server; anonymous and non-anonymous. In the former option, you log in with username anonymous and use your e-mail address as password. This is most commonly used when you want to distribute files for the whole world and not just specific persons. For more specific file transfer, like between two friends or giving people permission to access your home directory, you need a username and password.

Logging in to e.g. ftp.nvg.ntnu.no anonymously will give you access to mirrors with linux-distributions and similar entities, which are free for all.

Using text-based clients

By writing ftp in a command window in both Windows and *nix-based environments you will start the FTP-client. Then, to connect a machine you write open nameofmachine, where "nameofmachine" could be ftp.nvg.ntnu.no. Log in either anonymously or non-anonymously and you will get an answer looking something like this:

konsoll #1
            230 User hansjorg logged in.
            Remote system type is UNIX.
            ftp>
         

Here is a short summary of commonly used FTP-commands

Command Description
ls List files in the current directory
cd directoryname Change directory
get file Download file
put localfilename Upload file
lcd Change local downloadfolder
quit Quit FTP

If you want to transfer other types of files than just text, you have to use the command binary. If you don't, everything but plain text will be ruined during transfer.

For more commands with supplementary description you can use the commands help for overall help, and help command for assistance in relation to a specific command.

An alternative to the usual FTP-client in Unix/Linux/BSD-installations at NTNU is ncftp, which you use in the same way, but start with the command ncftp. It is equipped with more functions like bookmarks and storage of passwords.

FTP in web browsers

Most web browser have built-in FTP-client. All you have to do then is to use an address which somehow tells the web browser that you want to use its FTP-client. So if you want to use anonymous login you use the address ftp://ftp.nvg.ntnu.no/ if you want to connect to NVG's FTP-server at NTNU.

On the other hand, for non-anonymous login you use an address on the form ftp://username@ftp.nvg.ntnu.no/. Your web browser will then prompt you for your password.

Problems with FTP

Some FTP-clients have problems with symlinks, and a result of this is that you cannot access your public_html-directory. To solve this you can change directory to the directory the symlink points to. In a text-based client you do this with cd /local/www.stud/users/brukernavn. In clients with graphical interfaces you should be able to choose something like Change Dir, where you then can give the path /local/www.stud/users/brukernavn.

Another common problem is that the ls command might not work as a result of a firewall. A solution to this is turning on passive mode in the FTP-client.

FTP-alternatives

The easiest/most commonly used way of accessing your home directory is by connecting to it with samba, Windows-network. On the other hand, if your machine has neither Windows or Samba, you can use SFTP.

A third alternative is scp (Secure CoPy). You can find scp on most of NTNU's unix-machines and you can install it at home. To copy a file from a unix-machine to another you use scp filename username@othermachine:. In contrast to normal ftp, scp uses a secure connection so that the information transferred is protected and cannot easily be picked up.


Språk: en flag_no Kommentarer: 0 Aid: 520 Brukervurdering:
 
 
Sist oppdatert: 2007-08-01 Forfatter: livermor Lest: 274 ganger