TOPIC
FTP (File Transfer Protocol) is a way for computers to transfer files over an IP network. In Mac OS X Server, FTP is started up from the command line. This article provides the basic information needed to use the ftp program as a client on Mac OS X Server.
DISCUSSION Remote vs Local Computers First, a few terms need to be defined so that the information below is more clear. The computer that you are connecting to is the remote computer. It is also called a server. A local computer or client, is the computer that you are sitting in front of when connecting to a remote computer. Using FTP To start an FTP session, open /System/Administration/Terminal.app . This program allows you to access the command line interface that is built into Mac OS X Server. When Terminal.app is opened, a new window and a prompt appears. This is often called the command prompt, or command line because it is where you type in your commands. At the end of the prompt you see by default a % (percent) sign. Commands typed on the keyboard will appear to the right of the % prompt and will be executed when you press the Return (Enter) key. At the command prompt, type " ftp [hostname] " and press return where [hostname] is name of the remote computer. For example: ftp skye ftp skye.apple.com ftp 192.168.1.1 If a connection can be made to the remote computer you will be asked to provide a user name an password. If you do not have an account on the remote computer an FTP session may not be allowed. Some FTP sites are set up for anonymous FTP. This is done by many companies and individuals to provide access to public files or updates. These sites are called anonymous FTP sites because the user name to connect to these sites is literally "anonymous". The password is usually your e-mail address. If anonymous FTP is allowed it usually is stated in the message that appears when a connection is made. After a successful login the command prompt changes to "ftp>". Most of the standard Unix-compatible command line commands can be used in FTP. The most commonly used commands are " get " and " put ". Any files that are on the remote computer are downloaded to the local computer using the " get " command. Files that are transferred from the local computer to the remote computers are uploaded using the " put " command. For example, the command " get text " would download the file " text " to the local computer. " Put text " would upload the file " text " to the remote computer. To get a list of all the commands that FTP accepts, type " help " at the "ftp>" prompt. This lists all the available commands. Transfer Modes If you are going to upload or download a binary file (an application, compressed file, or anything that is more than a plain text file), FTP must be put in binary mode before the file transfer occurs. This is done by typing " binary " at the command line. This is the default mode for Mac OS X Server's FTP program. To switch to the ASCII transfer mode so that plain text files can be downloaded type " ascii " at the command line. If the incorrect transfer mode is used the file probably is not transferred correctly. Exiting FTP To terminate an FTP session, type " exit " at the "ftp>" prompt. The connection to the remote computer is terminated and the normal command prompt returns. This can also be done to exit the FTP session at anytime. FTP Server On Mac OS X Server Mac OS X Server comes with an FTP server. The server is off by default, but may have been turned on when the Setup Assistant was run. To be sure, open /System/Applications/Preferences.app . Double-click on the network option, and then click the "Services" tab. Here it is possible to turn on the FTP server, if you have root access. |
Document Information | |
Product Area: | Mac OS System Software |
Category: | Mac OS X Server |
Sub Category: | General Topics |
Keywords: | kmosXserver |
Copyright © 2000 Apple Computer, Inc. All rights reserved.