SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

BotDetect - Real-Time Bot Detection API
 
 

MAN page from Other ftp-client-krb5-1.3-6sls.i586.rpm

FTP

Section: User Commands (1)
Index 

NAME

ftp - ARPANET file transfer program 

SYNOPSIS

ftp[-v] [-d] [-i] [-n] [-g] [-krealm] [-f] [-x] [-u] [-t] [host] 

DESCRIPTION

FTPis the user interface to theARPANETstandard File Transfer Protocol. The program allows a user to transferfiles to and from a remote network site. 

OPTIONS

Options may be specified at the command line, or to the commandinterpreter.
-v
Verbose option forcesftpto show all responses from the remote server, as well as report on datatransfer statistics.
-n
Restrainsftpfrom attempting ``auto-login'' upon initial connection. If auto-loginis enabled,ftpwill check the.netrc(see below) file in the user's home directory for an entry describing anaccount on the remote machine. If no entry exists,ftpwill prompt for the remote machine login name (default is the useridentity on the local machine), and, if necessary, prompt for a passwordand an account with which to login.
-u
Restrainsftpfrom attempting ``auto-authentication'' upon initial connection. Ifauto-authentication is enabled,ftpattempts to authenticate to theFTPserver by sending theAUTHcommand, using whichever authentication types are locally supported.Once an authentication type is accepted, an authentication protocolwill proceed by issuingADATcommands. This option also disables auto-login.
-i
Turns off interactive prompting during multiple file transfers.
-d
Enables debugging.
-g
Disables file name globbing.
-k realm
When using Kerberos v4 authentication, gets tickets inrealm.
-f
Causes credentials to be forwarded to the remote host.
-x
Causes the client to attempt to negotiate encryption (data and commandprotection levels ``private'') immediately after successfullyauthenticating.
-t
Enables packet tracing.
 

COMMANDS

The client host with whichftpis to communicate may be specified on the command line. If this isdone,ftpwill immediately attempt to establish a connection to anFTPserver on that host; otherwise,ftpwill enter its command interpreter and await instructions from the user.Whenftpis awaiting commands from the user the prompt``ftp>''is provided to the user. The following commands are recognized byftp:
! [command] [args]]
Invoke an interactive shell on the local machine. If there arearguments, the first is taken to be a command to execute directly, withthe rest of the arguments as its arguments.
$ macro-name [args]
Execute the macromacro-namethat was defined with themacdefcommand. Arguments are passed to the macro unglobbed.
account [passwd]
Supply a supplemental password required by a remote system for access toresources once a login has been successfully completed. If no argumentis included, the user will be prompted for an account password in anon-echoing input mode.
append local-file [remote-file]
Append a local file to a file on the remote machine. Ifremote-fileis left unspecified, the local file name is used in naming the remotefile after being altered by anyntransornmapsetting. File transfer uses the current settings fortype,format,mode,andstructure.
ascii
Set the file transfertypeto networkASCII .This is the default type.
bell
Arrange that a bell be sounded after each file transfer command iscompleted.
binary
Set the file transfertypeto support binary file transfer.
bye
Terminate theFTPsession with the remote server and exitftp.An end of file will also terminate the session and exit.
case
Toggle remote computer file name case mapping duringmgetcommands. Whencaseis on (default is off), remote computer file names with all letters inupper case are written in the local directory with the letters mapped tolower case.
ccc
Turn off integrity protection on the command channel. This commandmust be sent integrity protected, and must be proceeded by a successfulADATcommand. Since turning off integrity protection potentiallyallows an attacker to insert commands onto the command channel, someFTPservers may refuse to honor this command.
cd remote-directory
Change the working directory on the remote machine toremote-directory.
cdup
Change the remote machine working directory to the parent of the currentremote machine working directory.
chmod mode file-name
Change the permission modes of the filefile-nameon the remote system tomode.
clear
Set the protection level on data transfers to ``clear''. If noADATcommand succeeded, then this is the default protection level.
close
Terminate theFTPsession with the remote server, and return to the command interpreter.Any defined macros are erased.
cprotect [protection-level]
Set the protection level on commands toprotection-level.The valid protection levels are ``clear'' for unprotected commands,``safe'' for commands integrity protected bycryptographic checksum, and ``private'' for commandsconfidentiality and integrity protected by encryption. If anADATcommand succeeded, then the default command protection level is``safe'', otherwise the only possible level is ``clear''. If nolevel is specified, the current level is printed.cprotect clearis equivalent to theccccommand.
cr
Toggle carriage return stripping during ascii type file retrieval.Records are denoted by a carriage return/linefeed sequence during asciitype file transfer. Whencris on (the default), carriage returns are stripped from this sequence toconform with theUNIXsingle linefeed record delimiter. Records on non-UNIX remote systemsmay contain single linefeeds; when an ascii type transfer is made, theselinefeeds may be distinguished from a record delimiter only whencris off.
delete remote-file
Delete the fileremote-fileon the remote machine.
debug [debug-value]
Toggle debugging mode. If an optionaldebug-valueis specified it is used to set the debugging level. When debugging ison,ftpprints each command sent to the remote machine, preceded by the string`-->'
dir [remote-directory] [local-file]
Print a listing of the directory contents in the directory,remote-directory,and, optionally, placing the output inlocal-file.If interactive prompting is on,ftpwill prompt the user to verify that the last argument is indeed thetarget local file for receivingdiroutput. If no directory is specified, the current working directory onthe remote machine is used. If no local file is specified, orlocal-fileis`-',output comes to the terminal.
disconnect
A synonym forclose.
form format
Set the file transferformtoformat.The default format is ``file''.
get remote-file [local-file]
Retrieve the fileremote-fileand store it on the local machine. If the local file name is notspecified, it is given the same name it has on the remote machine,subject to alteration by the currentcase,ntrans,andnmapsettings. The current settings fortype,form,mode,andstructureare used while transferring the file.
glob
Toggle filename expansion formdelete,mget,andmput.If globbing is turned off withglob,the file name arguments are taken literally and not expanded. Globbingformputis done as incsh(1).Formdeleteandmget,each remote file name is expanded separately on the remote machine andthe lists are not merged. Expansion of a directory name is likely to bedifferent from expansion of the name of an ordinary file: the exactresult depends on the foreign operating system and ftp server, and canbe previewed by doing`mls remote-files -'Note:mgetandmputare not meant to transfer entire directory subtrees of files. That canbe done by transferring atar(1)archive of the subtree (in binary mode).
hash
Toggle hash-sign (``#'') printing for each data block transferred. Thesize of a data block is 1024 bytes.
help [command]
Print an informative message about the meaning ofcommand.If no argument is given,ftpprints a list of the known commands.
idle [seconds]
Set the inactivity timer on the remote server tosecondsseconds. Ifsecondsis omitted, the current inactivity timer is printed.
lcd [directory]
Change the working directory on the local machine. If nodirectoryis specified, the user's home directory is used.
ls [remote-directory] [local-file]
Print a listing of the contents of a directory on the remote machine.The listing includes any system-dependent information that the serverchooses to include; for example, mostUNIXsystems will produce output from the command `ls -l'. (See alsonlist.)Ifremote-directoryis left unspecified, the current working directory is used. Ifinteractive prompting is on,ftpwill prompt the user to verify that the last argument is indeed thetarget local file for receivinglsoutput. If no local file is specified, or iflocal-fileis`-',the output is sent to the terminal.
macdefmacro-name
Define a macro. Subsequent lines are stored as the macromacro-name;a null line (consecutive newline characters in a file or carriagereturns from the terminal) terminates macro input mode. There is alimit of 16 macros and 4096 total characters in all defined macros.Macros remain defined until aclosecommand is executed. The macro processor interprets `$' and `\' asspecial characters. A `$' followed by a number (or numbers) is replacedby the corresponding argument on the macro invocation command line. A`$' followed by an `i' signals that macro processor that the executingmacro is to be looped. On the first pass `$i' is replaced by the firstargument on the macro invocation command line, on the second pass it isreplaced by the second argument, and so on. A `\' followed by anycharacter is replaced by that character. Use the `\' to preventspecial treatment of the `$'.
mdelete [remote-files]
Deleteremote-fileson the remote machine.
mdir remote-files local-file
Likedir,except multiple remote files may be specified. If interactive promptingis on,ftpwill prompt the user to verify that the last argument is indeed thetarget local file for receivingmdiroutput.
mget remote-files
Expand theremote-fileson the remote machine and do agetfor each file name thus produced. Seeglobfor details on the filename expansion. Resulting file names will thenbe processed according tocase,ntrans,andnmapsettings. Files are transferred into the local working directory, whichcan be changed with `lcd directory'; new local directories can becreated with`! mkdir directory'.
mkdir directory-name
Make a directory on the remote machine.
mls remote-files local-file
Likenlist,except multiple remote files may be specified, and thelocal-filemust be specified. If interactive prompting is on,ftpwill prompt the user to verify that the last argument is indeed thetarget local file for receivingmlsoutput.
mode [mode-name]
Set the file transfermodetomode-name.The default mode is ``stream'' mode.
modtime file-name
Show the last modification time of the file on the remote machine.
mput local-files
Expand wild cards in the list of local files given as arguments and do aputfor each file in the resulting list. Seeglobfor details of filename expansion. Resulting file names will then beprocessed according tontransandnmapsettings.
newer file-name
Get the file only if the modification time of the remote file is morerecent that the file on the current system. If the file does not existon the current system, the remote file is considerednewer.Otherwise, this command is identical toget.
nlist [remote-directory] [local-file]
Print a list of the files in a directory on the remote machine. Ifremote-directoryis left unspecified, the current working directory is used. Ifinteractive prompting is on,ftpwill prompt the user to verify that the last argument is indeed thetarget local file for receivingnlistoutput. If no local file is specified, or iflocal-fileis `-', the output is sent to the terminal.
nmap [inpattern outpattern]
Set or unset the filename mapping mechanism. If no arguments arespecified, the filename mapping mechanism is unset. If arguments arespecified, remote filenames are mapped duringmputcommands andputcommands issued without a specified remote target filename.If arguments are specified, local filenames are mapped duringmgetcommands andgetcommands issued without a specified local target filename. This commandis useful when connecting to non-UNIX remote computer with differentfile naming conventions or practices. The mapping follows the patternset byinpatternandoutpattern.[Inpattern] is a template for incoming filenames (which may havealready been processed according to thentransandcasesettings). Variable templating is accomplished by including thesequences `$1', `$2', ..., `$9' ininpattern.Use `\' to prevent this special treatment of the `$' character. Allother characters are treated literally, and are used to determine thenmap[inpattern] variable values. For example, giveninpattern$1.$2 and the remote file name "mydata.data", $1 would have the value"mydata", and $2 would have the value "data". Theoutpatterndetermines the resulting mapped filename. The sequences `$1', `$2',inpatterntemplate. The sequence `$0' is replace by the original filename.Additionally, the sequence `[seq1, seq2]' is replaced by[seq1] ifseq1is not a null string; otherwise it is replaced byseq2.For example, the command

        nmap $1.$2.$3 [$1,$2].[$2,file]

would yield the output filename "myfile.data" for input filenames"myfile.data" and "myfile.data.old", "myfile.file" for the inputfilename "myfile", and "myfile.myfile" for the input filename ".myfile".Spaces may be included inoutpattern,as in the example: `nmap $1 sed "s/ *$//" > $1'. Use the `\' characterto prevent special treatment of the `$','[',']', and `,' characters.

ntrans [inchars [outchars]]
Set or unset the filename character translation mechanism. If noarguments are specified, the filename character translation mechanism isunset. If arguments are specified, characters in remote filenames aretranslated duringmputcommands andputcommands issued without a specified remote target filename. Ifarguments are specified, characters in local filenames are translatedduringmgetcommands andgetcommands issued without a specified local target filename. This commandis useful when connecting to a non-UNIX remote computer with differentfile naming conventions or practices. Characters in a filename matchinga character inincharsare replaced with the corresponding character inoutchars.If the character's position inincharsis longer than the length ofoutchars,the character is deleted from the file name.
open host [port] [-forward]
Establish a connection to the specifiedhostFTPserver. An optional port number may be supplied, in which case,ftpwill attempt to contact anFTPserver at that port. If theauto-authenticateoption is on (default),ftpwill attempt to authenticate to theFTPserver by sending theAUTHcommand, using whichever authentication types which are locallysupported. Once an authentication type is accepted, an authenticationprotocol will proceed by issuingADATcommands. If theauto-loginoption is on (default),ftpwill also attempt to automatically log the user in to theFTPserver (see below). If the-forwardoption is specified,ftpwill forward a copy of the user's Kerberos tickets to the remote host.
passive
Toggle passive data transfer mode. In passive mode, the client initiatesthe data connection by listening on the data port. Passive mode maybe necessary for operation from behind firewalls which do not permitincoming connections.
private
Set the protection level on data transfers to ``private''. Datatransmissions are confidentiality and integrity protected by encryption.If noADATcommand succeeded, then the only possible level is ``clear''.
prompt
Toggle interactive prompting. Interactive prompting occurs duringmultiple file transfers to allow the user to selectively retrieve orstore files. If prompting is turned off (default is on), anymgetormputwill transfer all files, and anymdeletewill delete all files.
protect [protection-level]
Set the protection level on data transfers toprotection-level.The valid protection levels are ``clear'' for unprotected datatransmissions, ``safe'' for data transmissions integrity protected bycryptographic checksum, and ``private'' for data transmissionsconfidentiality and integrity protected by encryption. If noADATcommand succeeded, then the only possible level is ``clear''. If nolevel is specified, the current level is printed. The defaultprotection level is ``clear''.
proxy ftp-command
Execute an ftp command on a secondary control connection. This commandallows simultaneous connection to two remote ftp servers fortransferring files between the two servers. The firstproxycommand should be anopen ,to establish the secondary control connection. Enter the command "proxy ?" to see other ftp commands executable on the secondary connection.The following commands behave differently when prefaced byproxy:openwill not define new macros during the auto-login process,closewill not erase existing macro definitions,getandmgettransfer files from the host on the primary control connection to thehost on the secondary control connection, andput,mput,andappendtransfer files from the host on the secondary control connection to thehost on the primary control connection. Third party file transfersdepend upon support of the ftp protocolPASVcommand by the server on the secondary control connection.
put local-file [remote-file]
Store a local file on the remote machine. Ifremote-fileis left unspecified, the local file name is used after processingaccording to anyntransornmapsettings in naming the remote file. File transfer uses the currentsettings fortype,format,mode,andstructure.
pwd
Print the name of the current working directory on the remote machine.
quit
A synonym forbye.
quote arg1 [arg2] [...]
The arguments specified are sent, verbatim, to the remoteFTPserver.
recv remote-file [local-file]
A synonym for get.
reget remote-file [local-file]
Reget acts like get, except that iflocal-fileexists and is smaller thanremote-file,local-fileis presumed to be a partially transferred copy ofremote-fileand the transfer is continued from the apparent point of failure. Thiscommand is useful when transferring very large files over networks thatare prone to dropping connections.
remotehelp [command-name]
Request help from the remoteFTPserver. If acommand-nameis specified it is supplied to the server as well.
remotestatus [file-name]
With no arguments, show status of remote machine. Iffile-nameis specified, show status offile-nameon remote machine.
rename [from] [to]
Rename the filefromon the remote machine, to the fileto.
reset
Clear reply queue. This command re-synchronizes command/replysequencing with the remote ftp server. Resynchronization may benecessary following a violation of the ftp protocol by the remoteserver.
restart marker
Restart the immediately followinggetorputat the indicatedmarker.On UNIX systems, marker is usually a byte offset into the file.
rmdir directory-name
Delete a directory on the remote machine.
runique
Toggle storing of files on the local system with unique filenames. If afile already exists with a name equal to the target local filename for agetormgetcommand, a ".1" is appended to the name. If the resulting name matchesanother existing file, a ".2" is appended to the original name. If thisprocess continues up to ".99", an error message is printed, and thetransfer does not take place. The generated unique filename will bereported. Note thatruniquewill not affect local files generated from a shell command (see below).The default value is off.
safe
Set the protection level on data transfers to ``safe''. Datatransmissions are integrity-protected by cryptographic checksum. If noADATcommand succeeded, then the only possible level is ``clear''.
send local-file [remote-file]
A synonym for put.
sendport
Toggle the use ofPORTcommands. By default,ftpwill attempt to use aPORTcommand when establishing a connection for each data transfer. The useofPORTcommands can prevent delays when performing multiple file transfers. IfthePORTcommand fails,ftpwill use the default data port. When the use ofPORTcommands is disabled, no attempt will be made to usePORTcommands for each data transfer. This is useful for certainFTPimplementations which do ignorePORTcommands but, incorrectly, indicate they've been accepted.
site arg1 [arg2] [...]
The arguments specified are sent, verbatim, to the remoteFTPserver as aSITEcommand.
size file-name
Return size offile-nameon remote machine.
status
Show the current status offtp.
struct struct-name
Set the file transferstructuretostruct-name.By default ``stream'' structure is used.
sunique
Toggle storing of files on remote machine under unique file names.Remote ftp server must support ftp protocolSTOUcommand for successful completion. The remote server will report uniquename. Default value is off.
system
Show the type of operating system running on the remote machine.
tenex
Set the file transfer type to that needed to talk toTENEXmachines.
trace
Toggle packet tracing.
type [type-name]
Set the file transfertypetotype-name.If no type is specified, the current type is printed. The default typeis networkASCII.
umask [newmask]
Set the default umask on the remote server tonewmask.Ifnewmaskis omitted, the current umask is printed.
user user-name [password] [account]
Identify yourself to the remoteFTPserver. If thepasswordis not specified and the server requires it,ftpwill prompt the user for it (after disabling local echo). If anaccountfield is not specified, and theFTPserver requires it, the user will be prompted for it. If anaccountfield is specified, an account command will be relayed to the remoteserver after the login sequence is completed if the remote server didnot require it for logging in. Unlessftpis invoked with ``auto-login'' disabled, this process is doneautomatically on initial connection to theFTPserver.
verbose
Toggle verbose mode. In verbose mode, all responses from theFTPserver are displayed to the user. In addition, if verbose is on, when afile transfer completes, statistics regarding the efficiency of thetransfer are reported. By default, verbose is on.
? [command]
A synonym for help.

Command arguments which have embedded spaces may be quoted with quote`"' marks. 

ABORTING A FILE TRANSFER

To abort a file transfer, use the terminal interrupt key (usuallyCtrl-C). Sending transfers will be immediately halted. Receivingtransfers will be halted by sending a FTPprotocolABORcommand to the remote server, and discarding any further data received.The speed at which this is accomplished depends upon the remote server'ssupport forABORprocessing. If the remote server does not support theABORcommand, an `ftp>' prompt will not appear until the remote server hascompleted sending the requested file.

The terminal interrupt key sequence will be ignored whenftphas completed any local processing and is awaiting a reply from theremote server. A long delay in this mode may result from theABORprocessing described above, or from unexpected behavior by the remoteserver, including violations of the ftp protocol. If the delay resultsfrom unexpected remote server behavior, the localftpprogram must be killed by hand. 

FILE NAMING CONVENTIONS

Files specified as arguments toftpcommands are processed according to the following rules.
1.
If the file name `-' is specified,stdin(for reading) orstdout(for writing) is used.
2.
If the first character of the file name is `|', the remainder of theargument is interpreted as a shell command.Ftpthen forks a shell, usingpopen(3)with the argument supplied, and reads from (writes to) stdout (stdin).If the shell command includes spaces, the argument must be quoted; e.g.``" ls -lt"''. A particularly useful example of this mechanism is:``dir more''.
3.
Failing the above checks, if ``globbing'' is enabled, local file namesare expanded according to the rules used incsh(1);c.f. theglobcommand. If theftpcommand expects a single local file (.e.g.put),only the first filename generated by the ``globbing'' operation is used.
4.
Formgetcommands andgetcommands with unspecified local file names, the local filename is theremote filename, which may be altered by acase,ntrans,ornmapsetting. The resulting filename may then be altered ifruniqueis on.
5.
Formputcommands andputcommands with unspecified remote file names, the remote filename is thelocal filename, which may be altered by antransornmapsetting. The resulting filename may then be altered by the remoteserver ifsuniqueis on.
 

FILE TRANSFER PARAMETERS

The FTP specification specifies many parameters which may affect a filetransfer. Thetypemay be one of ``ascii'', ``image'' (binary), ``ebcdic'', and ``localbyte size'' (mostly for PDP-10's and PDP-20's).Ftpsupports the ascii and image types of file transfer, plus local bytesize 8 fortenexmode transfers.

Ftpsupports only the default values for the remaining file transferparameters:mode,form,andstruct. 

THE .netrc FILE

The.netrcfile contains login and initialization information used by theauto-login process. It resides in the user's home directory. Thefollowing tokens are recognized; they may be separated by spaces, tabs,or new-lines:
machine name
Identify a remote machinename.The auto-login process searches the.netrcfile for amachinetoken that matches the remote machine specified on theftpcommand line or as anopencommand argument. Once a match is made, the subsequent.netrctokens are processed, stopping when the end of file is reached oranothermachineor adefaulttoken is encountered.
default
This is the same asmachinenameexcept thatdefaultmatches any name. There can be only onedefaulttoken, and it must be after allmachinetokens. This is normally used as:


     default login anonymous password userAATTsite

thereby giving the userautomaticanonymous ftp login to machines not specified in.netrc.This can be overridden by using the-nflag to disable auto-login.

login name
Identify a user on the remote machine. If this token is present, theauto-login process will initiate a login using the specifiedname.
password string
Supply a password. If this token is present, the auto-login processwill supply the specified string if the remote server requires apassword as part of the login process. Note that if this token ispresent in the.netrcfile for any user other thananonymous,ftpwill abort the auto-login process if the.netrcis readable by anyone besides the user.
account string
Supply an additional account password. If this token is present, theauto-login process will supply the specified string if the remote serverrequires an additional account password, or the auto-login process willinitiate anACCTcommand if it does not.
macdef name
Define a macro. This token functions like theftpmacdefcommand functions. A macro is defined with the specified name; itscontents begin with the next.netrcline and continue until a null line (consecutive new-line characters) isencountered. If a macro namedinitis defined, it is automatically executed as the last step in theauto-login process.
 

ENVIRONMENT

Ftputilizes the following environment variables.
HOME
For default location of a.netrcfile, if one exists.
SHELL
For default shell.
 

SEE ALSO

ftpd(8)

Lunt, S. J., FTP Security Extensions, Internet Draft, November 1993. 

HISTORY

Theftpcommand appeared in 4.2BSD. 

BUGS

Correct execution of many commands depends upon proper behavior by theremote server.

An error in the treatment of carriage returns in the 4.2BSD ascii-modetransfer code has been corrected. This correction may result inincorrect transfers of binary files to and from 4.2BSD servers using theascii type. Avoid this problem by using the binary image type.


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
COMMANDS
ABORTING A FILE TRANSFER
FILE NAMING CONVENTIONS
FILE TRANSFER PARAMETERS
THE .netrc FILE
ENVIRONMENT
SEE ALSO
HISTORY
BUGS

This document was created byman2html,using the manual pages.
 
ICM Bot detect detector