¿Cómo usar ftp por línea de comando en Linux o Windows?
¿Cómo usar ftp por línea de comando en Linux o Windows?

¿Cómo usar ftp por línea de comando en Linux o Windows?

Para subir, bajar o administrar el contenido de un FTP tenemos un sin fin de aplicaciones gráficas. Filezilla es de las más populares y la que uso desde mi portátil. Pero, ¿Cómo usar ftp por línea de comando en Linux o Windows?

Sobre todo cuando trabajamos en un servidor y no tenemos GUI (entorno grafico), necesitamos subir algún archivo a un FTP o simplemente borrar algo, crear una carpeta, etc, hacer cualquier cosa y solo contamos con nuestra terminal, nada más.

Para trabajar con un servidor FTP nos basta un solo comando:

ftp

Ponemos el comando ftp y seguido de él la dirección IP (o dominio) del servidor FTP al que deseamos conectarnos y listo, por ejemplo:

ftp 192.168.1.2

El comando Ftp solicitará el usuario, lo escribimos y presionamos Enter, seguidamente nos pedirá la contraseña, lo escribimos y presionamos Enter, listo ya entramos y podemos usar el ftp por linea de comandos desde un windows o linux

Ahora es donde escribimos los comandos en la shell de ftp.

Hacemos un ejemplo sencillo, para listar los archivos del ftp remoto usamos el comando ls

Hay muchos más comandos, por ejemplo:

mkdir : Crear carpetas
chmod : Cambiar permisos
delete : Borrar archivos
get: obtener un archivo.
mget: obtener multiples archivos.
mput: poner varios archivos.

Si ejecutamos el comando help nos da todos los comandos que podemos usar

! delete mdelete proxy runique
$ debug mdir sendport send
account dir mget put size
append disconnect mkdir pwd status
ascii form mls quit struct
bell get mode quote sunique
binary glob modtime recv system
bye hash mput remotehelp tenex
case help nmap rstatus trace
cd image nlist rhelp type
cdup lcd ntrans rename user
close ls open reset verbose
cr macdef prompt rmdir ?
ftp> remotehelp

Se parecen kos comandos a los de la shell de Linux,¿Verdad?

¿Cómo subir un archivo por ftp?

Para subir un archivo el comando es send

La sintaxis es:

send archivo-local archivo-final

Por ejemplo, supongamos que tengo en mi Home un archivo llamado foto.jpg y quiero subirla a una carpeta llamada fotos, el comando sería:

send foto.jpg fotos/foto.jpg

Siempre deben especificar el nombre del aechivo final, no importa si es el mismo o si no desean que cambien, deben especificarlo igual, es obligatorio.

Así de simple, el log/output que nos devuelve es similar a este:

local: foto.jpg remote: fotos/foto.jpg
200 PORT command successful.
150 Opening BINARY mode data connection for test.
226 Transfer complete. 0 bytes transferred. 0.00 KB/sec.

¿Cómo bajar un archivo por ftp?

Para subir un archivo el comando es send

La sintaxis es:

get archivo-remoto archivo-local

Por ejemplo, supongamos que tengo en remoto una carpeta llamada fotos y queremos el archivo foto.jpg, el comando sería:

send fotos/foto.jpg foto.jpg

Si desean conocer muchas más opciones basta con leerse el manual del comando:

man ftp

ftp

Purpose

Transfers files between a local and a remote host.

Syntax

ftp [ -d ] [ -g ] [ -i ] [ -n ] [ -v ] [ HostName [ Port
] ]

Description

The ftp command uses the File Transfer Protocol (FTP) to transfer
files between the local host and a remote host or between two remote
hosts.

The FTP protocol allows data transfer between hosts that use dissimilar
file systems. Although the protocol provides a high degree of flexibility
in transferring data, it does not attempt to preserve file attributes
(such as the protection mode or modification times of a file) that
are specific to a particular file system. Moreover, the FTP protocol
makes few assumptions about the overall structure of a file system
and does not provide or allow such functions as recursively copying
subdirectories.

Note: If you are transferring files between systems and need to preserve
file attributes or recursively copy subdirectories, use the rcp command.

Issuing Subcommands

At the ftp> prompt, you can enter subcommands to perform tasks such
as listing remote directories, changing the current local and remote
directory, transferring multiple files in a single request, creating
and removing directories, and escaping to the local shell to perform
shell commands. See the “Subcommands” section for a description of
each subcommand.

If you execute the ftp command and do not specify the HostName parameter
for a remote host, the ftp command immediately displays the ftp>
prompt and waits for an ftp subcommand. To connect to a remote host,
execute the open subcommand. When the ftp command connects to the
remote host, the ftp command then prompts for the login name and password
before displaying the ftp> prompt again. The ftp command is unsuccessful
if no password is defined at the remote host for the login name.

The ftp command interpreter, which handles all subcommands entered
at the ftp> prompt, provides facilities that are not available with
most file-transfer programs, such as:

* Handling file-name parameters to ftp subcommands

* Collecting a group of subcommands into a single subcommand
macro

* Loading macros from a $HOME/.netrc file

These facilities help simplify repetitive tasks and allow you to use
the ftp command in unattended mode.

The command interpreter handles file-name parameters according to
the following rules:

* If a – (hyphen) is specified for the parameter, standard input
(stdin) is used for read operations and standard output (stdout) is
used for write operations.

* If the preceding check does not apply and file-name expansion
is enabled (see the -g flag or the glob subcommand), the interpreter
expands the file name according to the rules of the C shell. When
globbing is enabled and a pattern-matching character is used in a
subcommand that expects a single file name, results may be different
than expected.

For example, the append and put subcommands perform file-name expansion
and then use only the first file name generated. Other ftp subcommands,
such as cd, delete, get, mkdir, rename, and rmdir, do not perform
file-name expansion and take the pattern-matching characters literally.

* For the get, put, mget, and mput subcommands, the interpreter
has the ability to translate and map between different local and remote
file-name syntax styles (see the case, ntrans, and nmap subcommands)
and the ability to modify a local file name if it is not unique (see
the runique subcommand). Additionally, the ftp command can send instructions
to a remote ftpd server to modify a remote file name if it is not
unique (see the sunique subcommand).

* Use double quotes (” “) to specify parameters that include
blank characters.

Note: The ftp command interpreter does not support pipes. It also
does not necessarily support all multibyte-character file names.

To end an ftp session when you are running interactively, use the
quit or bye subcommand or the End of File (Ctrl-D) key sequence at
the ftp> prompt. To end a file transfer before it has completed,
press the Interrupt key sequence. The default Interrupt key sequence
is Ctrl-C. The stty command can be used to redefine this key sequence.

The ftp command normally halts transfers being sent (from the local
host to the remote host) immediately. The ftp command halts transfers
being received (from the remote host to the local host) by sending
an FTP ABOR instruction to the remote FTP server and discarding all
incoming file transfer packets until the remote server stops sending
them. If the remote server does not support the ABOR instruction,
the ftp command does not display the ftp> prompt until the remote
server has sent all of the requested file. Additionally, if the remote
server does something unexpected, you may need to end the local ftp
process.

Security and Automatic Login

The ftp command also handles security by sending passwords to the
remote host and permits automatic login, file transfers, and logoff.

If you execute the ftp command and specify the host name (HostName)
of a remote host, the ftp command tries to establish a connection
to the specified host. If the ftp command connects successfully, the
ftp command searches for a local $HOME/.netrc file in your current
directory or home directory. If the file exists, the ftp command searches
the file for an entry initiating the login process and command macro
definitions for the remote host. If the $HOME/.netrc file or automatic
login entry does not exist or if your system has been secured with
the securetcpip command, the ftp command prompts the user for a user
name and password. The command displays the prompt whether or not
the HostName parameter is specified on the command line.

Note: The queuing system does not support multibyte host names.

If the ftp command finds a $HOME/.netrc automatic login entry for
the specified host, the ftp command attempts to use the information
in that entry to log in to the remote host. The ftp command also loads
any command macros defined in the entry. In some cases (for example,
when the required password is not listed in an automatic login entry),
the ftp command prompts for the password before displaying the ftp
> prompt.

Once the ftp command completes the automatic login, the ftp command
executes the init macro if the macro is defined in the automatic login
entry. If the init macro does not exist or does not contain a quit
or bye subcommand, the ftp command then displays the ftp> prompt
and waits for a subcommand.

Note: The remote user name specified either at the prompt or in a
$HOME/.netrc file must exist and have a password defined at the remote
host. Otherwise, the ftp command fails.

The HostName parameter is the name of the host machine to which files
are transferred. The optional Port parameter specifies the ID of the
port through which to transmit. (The /etc/services file specifies
the default port.)

Flags

-d Sends debugging information about ftp command operations to the
syslogd daemon. If you specify the -d flag, you must edit the /etc/syslog.conf
file and add one of the following entries:

user.info FileName

OR

user.debug FileName

Note: The syslogd daemon debug level includes info level messages.

If you do not edit the /etc/syslog.conf file, no messages are produced.
After changing the /etc/syslog.conf file, run the refresh -s syslogd
or kill -1 SyslogdPID command to inform the syslogd daemon of the
changes to its configuration file. For more information about debug
levels, refer to the /etc/syslog.conf file. Also, refer to the debug
subcommand.

-g Disables the expansion of metacharacters in file names. Interpreting
metacharacters can be referred to as expanding (sometimes called globbing)
a file name. See the glob subcommand.

-i Turns off interactive prompting during multiple file transfers.
See the prompt, mget, mput, and mdelete subcommands for descriptions
of prompting during multiple file transfers.

-n Prevents an automatic login on the initial connection. Otherwise,
the ftp command searches for a $HOME/.netrc entry that describes the
login and initialization process for the remote host. See the user
subcommand.

-v Displays all the responses from the remote server and provides
data transfer statistics. This display mode is the default when the
output of the ftp command is to a terminal, such as the console or
a display.

If stdin is not a terminal, the ftp command disables verbose mode
unless the user invoked the ftp command with the -v flag or issued
the verbose subcommand.

Subcommands

The following ftp subcommands can be entered at the ftp> prompt.
Use double quotes (” “) to specify parameters that include blank characters.

![Command [Parameters]] Invokes an interactive shell on the local
host. An optional command, with one or more optional parameters, can
be given with the shell command.

$Macro [Parameters] Executes the specified macro, previously defined
with the macdef subcommand. Parameters are not expanded.

?[Subcommand] Displays a help message describing the subcommand.
If you do not specify a Subcommand parameter, the ftp command displays
a list of known subcommands.

account [Password] Sends a supplemental password that a remote host
may require before granting access to its resources. If the password
is not supplied with the command, the user is prompted for the password.
The password is not displayed on the screen.

append LocalFile [RemoteFile] Appends a local file to a file on
the remote host. If the remote file name is not specified, the local
file name is used, altered by any setting made with the ntrans subcommand
or the nmap subcommand. The append subcommand uses the current values
for form, mode, struct, and type subcommands while appending the file.

ascii Synonym for the type ascii subcommand.

bell Sounds a bell after the completion of each file transfer.

binary Synonym for the type binary subcommand.

block Synonym for the mode block subcommand.

bye Ends the file-transfer session and exits the ftp command. Same
as the quit subcommand.

carriage-control Synonym for the form carriage-control subcommand.

case Sets a toggle for the case of file names. When the case subcommand
is On, the ftp command changes remote file names displayed in all
capital letters from uppercase to lowercase when writing them in the
local directory. The default is Off (so the ftp command writes uppercase
remote file names in uppercase in the local directory).

cd RemoteDirectory Changes the working directory on the remote host
to the specified directory.

cdup Changes the working directory on the remote host to the parent
of the current directory.

close Ends the file-transfer session, but does not exit the ftp command.
Defined macros are erased. Same as the disconnect subcommand.

copylocal Toggles local copy. copylocal defaults to off. An effort
is made by ftp to make sure you do not zero out a file by ftp’ing
it to itself (eg. same hostname, same pathname). Turning copylocal
ON bypasses this check.

cr Strips the carriage return character from a carriage return and
line-feed sequence when receiving records during ASCII-type file transfers.
(The ftp command terminates each ASCII-type record with a carriage
return and line feed during file transfers.)

Records on non-AIX remote hosts can have single line feeds embedded
in records. To distinguish these embedded line feeds from record delimiters,
set the cr subcommand to Off. The cr subcommand toggles between On
and Off.

delete RemoteFile Deletes the specified remote file.

debug [0 | 1] Toggles debug record keeping On and Off. Specify debug
or debug 1 to print each command sent to the remote host and save
the restart control file. Specify debug again, or debug 0, to stop
the debug record keeping. The Ctrl-C key sequence also saves the restart
control file.

Specifying the debug subcommand sends debugging information about
ftp command operations to the syslogd daemon. If you specify the debug
subcommand, you must edit the /etc/syslog.conf file and add one of
the following entries:

user.info FileName

OR

user.debug FileName

Note: The syslogd daemon debug level includes info level messages.

If you do not edit the /etc/syslog.conf file, no messages are produced.
After changing the /etc/syslog.conf file, run the refresh -s syslogd
or kill -1 SyslogdPID command to inform the syslogd daemon of the
changes to its configuration file. For more information about debug
levels, refer to the /etc/syslog.conf file. Also, refer to the ftp
-d flag.

dir [RemoteDirectory][LocalFile] Writes a listing of the contents
of the specified remote directory (RemoteDirectory) to the specified
local file (LocalFile). If the RemoteDirectory parameter is not specified,
the dir subcommand lists the contents of the current remote directory.
If the LocalFile parameter is not specified or is a – (hyphen), the
dir subcommand displays the listing on the local terminal.

disconnect Ends the file-transfer session but does not exit the ftp
command. Defined macros are erased. Same as the close subcommand.

ebcdic Synonym for the type ebcdic subcommand.

exp_cmd Toggles between conventional and experimental protocol commands.
The default is off.

file Synonym for the struct file subcommand.

form [ carriage-control | non-print | telnet ] Specifies the form
of the file transfer. The form subcommand modifies the type subcommand
to send the file transfer in the indicated form. Valid arguments are
carriage-control, non-print, and telnet.

carriage-control Sets the form of the file transfer to carriage-control.

non-print Sets the form of the file transfer to non-print.

telnet Sets the form of the file transfer to Telnet. Telnet is a Transmission
Control Protocol/Internet Protocol (TCP/IP) protocol that opens connections
to a system.

get RemoteFile [LocalFile] Copies the remote file to the local host.
If the LocalFile parameter is not specified, the remote file name
is used locally and is altered by any settings made by the case, ntrans,
and nmap subcommands. The ftp command uses the current settings for
the type, form, mode, and struct subcommands while transferring the
file.

glob Toggles file-name expansion (globbing) for the mdelete, mget,
and mput subcommands. If globbing is disabled, file-name parameters
for these subcommands are not expanded. When globbing is enabled and
a pattern-matching character is used in a subcommand that expects
a single file name, results may be different than expected.

For example, the append and put subcommands perform file-name expansion
and then use only the first file name generated. Other ftp subcommands,
such as cd, delete, get, mkdir, rename, and rmdir, do not perform
file-name expansion and take the pattern-matching characters literally.

Globbing for the mput subcommand is done locally in the same way as
for the csh command. For the mdelete and mget subcommands, each file
name is expanded separately at the remote machine and the lists are
not merged. The expansion of a directory name can be different from
the expansion of a file name, depending on the remote host and the
ftp server.

To preview the expansion of a directory name, use the mls subcommand:

mls RemoteFile

To transfer an entire directory subtree of files, transfer a tar archive
of the subtree in binary form, rather than using the mget or mput
subcommand.

hash Toggles hash sign (#) printing. When the hash subcommand is
on, the ftp command displays one hash sign for each data block (1024
bytes) transferred.

help [Subcommand] Displays help information. See the ? subcommand.

image Synonym for the type image subcommand.

lcd [Directory] Changes the working directory on the local host.
If you do not specify a directory, the ftp command uses your home
directory.

local M Synonym for the type local M subcommand.

ls [RemoteDirectory] [LocalFile] Writes an abbreviated file listing
of a remote directory to a local file. If the RemoteDirectory parameter
is not specified, the ftp command lists the current remote directory.
If the LocalFile parameter is not specified or is a – (hyphen), the
ftp command displays the listing on the local terminal.

macdef Macro Defines a subcommand macro. Subsequent lines up to a
null line (two consecutive line feeds) are saved as the text of the
macro. Up to 16 macros, containing at most 4096 characters for all
macros, can be defined. Macros remain defined until either redefined
or a close subcommand is executed.

The $ (dollar sign) and \ (backslash) are special characters in ftp
macros. A $ symbol followed by one or more numbers is replaced by
the corresponding macro parameter on the invocation line (see the
$ subcommand). A $ symbol followed by the letter i indicates that
the macro is to loop, with the $i character combination being replaced
by consecutive parameters on each pass.

The first macro parameter is used on the first pass, the second parameter
is used on the second pass, and so on. A \ symbol prevents special
treatment of the next character. Use the \ symbol to turn off the
special meanings of the $ and \. (backslash period) symbols.

mdelete RemoteFiles Expands the files specified by the RemoteFiles
parameter at the remote host and deletes the remote files.

mdir [RemoteDirectories LocalFile] Expands the directories specified
by the RemoteDirectories parameter at the remote host and writes a
listing of the contents of those directories to the file specified
in the LocalFile parameter. If the RemoteDirectories parameter contains
a pattern-matching character, the mdir subcommand prompts for a local
file if none is specified. If the RemoteDirectories parameter is a
list of remote directories separated by blanks, the last argument
in the list must be either a local file name or a – (hyphen).

If the LocalFile parameter is – (hyphen), the mdir subcommand displays
the listing on the local terminal. If interactive prompting is on
(see the prompt subcommand), the ftp command prompts the user to verify
that the last parameter is a local file and not a remote directory.

mget RemoteFiles Expands the RemoteFiles parameter at the remote host
and copies the indicated remote files to the current directory on
the local host. See the glob subcommand for more information on file-name
expansion. The remote file names are used locally and are altered
by any settings made by the case, ntrans, and nmap subcommands. The
ftp command uses the current settings for the form, mode, struct,
and type subcommands while transferring the files.

mkdir [RemoteDirectory] Creates the directory specified in the RemoteDirectory
parameter on the remote host.

mls [RemoteDirectories LocalFile] Expands the directories specified
in the RemoteDirectories parameter at the remote host and writes an
abbreviated file listing of the indicated remote directories to a
local file. If the RemoteDirectories parameter contains a pattern-matching
character, the mls subcommand prompts for a local file if none is
specified. If the RemoteDirectories parameter is a list of remote
directories separated by blanks, the last argument in the list must
be either a local file name or a – (hyphen).

If the LocalFile parameter is – (hyphen), the mls subcommand displays
the listing on the local terminal. If interactive prompting is on
(see the prompt subcommand), the ftp command prompts the user to verify
that the last parameter is a local file and not a remote directory.

mode [ stream | block ] Sets file-transfer mode. If an argument
is not supplied, the default is stream.

block Sets the file-transfer mode to block.

stream Sets the file-transfer mode to stream.

modtime Shows the last modification time of the specified file on
the remote machine. If the ftp command is not connected to a host
prior to execution, the modtime subcommand terminates with an error
message. The ftp command ignores parameter beyond the first parameter.
If the FileName parameter is not specified, the ftp command prompts
for a file name. If no file name is given, the ftp command sends a
usage message to standard output and terminates the subcommand.

If the name specified by the FileName parameter exists on the remote
host, and the name specifies a file, then the ftp command sends a
message containing the last modification time of the file to standard
output and terminates the subcommand. If FileName specifies a directory,
the ftp command sends an error message to standard output and terminates
the subcommand.

Note: The modtime subcommand interprets metacharacters when allowed.

mput [LocalFiles] Expands the files specified in the LocalFiles
parameter at the local host and copies the indicated local files to
the remote host. See the glob subcommand for more information on file-name
expansion. The local file names are used at the remote host and are
altered by any settings made by the ntrans and nmap subcommands. The
ftp command uses the current settings for the type, form, mode, and
struct subcommands while transferring the files.

nlist [RemoteDirectory][LocalFile] Writes a listing of the contents
of the specified remote directory (RemoteDirectory) to the specified
local file (LocalFile). If the RemoteDirectory parameter is not specified,
the nlist subcommand lists the contents of the current remote directory.
If the LocalFile parameter is not specified or is a – (hyphen), the
nlist subcommand displays the listing on the local terminal.

nmap [InPattern OutPattern] Turns the file-name mapping mechanism
On or Off. If no parameters are specified, file-name mapping is turned
off. If parameters are specified, source file names are mapped for
the mget and mput subcommands and for the get and put subcommands
when the destination file name is not specified. This subcommand is
useful when the local and remote hosts use different file-naming conventions
or practices. Mapping follows the pattern set by the InPattern and
OutPattern parameters.

The InPattern parameter specifies the template for incoming file names,
which may have already been processed according to the case and ntrans
settings. The template variables $1 through $9 can be included in
the InPattern parameter. All characters in the InPattern parameter
other than the $ (dollar sign) and the \$ (backslash, dollar sign)
define the values of the template variables. For example, if the InPattern
parameter is $1.$2 and the remote file name is mydata.dat, the value
of $1 is mydata and the value of $2 is dat.

The OutPattern parameter determines the resulting file name. The variables
$1 through $9 are replaced by their values as derived from the InPattern
parameter, and the variable $0 is replaced by the original file name.
Additionally, the sequence [Sequence1,Sequence2] is replaced by
the value of Sequence1, if Sequence1 is not null; otherwise, it is
replaced by the value of Sequence2. For example, the subcommand:

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

would yield myfile.data from myfile.data or myfile.data.old, myfile.file
from myfile, and myfile.myfile from .myfile. Use the \ (backslash)
symbol to prevent the special meanings of the $ (dollar sign), [
(left bracket), ] (right bracket), and , (comma) in the OutPattern
parameter.

non-print Synonym for the form non-print subcommand.

ntrans [InCharacters [OutCharacters]] Turns the file-name character
translation mechanism On and Off. If no parameters are specified,
character translation is turned off. If parameters are specified,
characters in source file names are translated for mget and mput subcommands
and for get and put subcommands when the destination file name is
not specified.

This subcommand is useful when the local and remote hosts use different
file-naming conventions or practices. Character translation follows
the pattern set by the InCharacters and OutCharacters parameter. Characters
in a source file name matching characters in the InCharacters parameter
are replaced by the corresponding characters in the OutCharacters
parameter.

If the string specified by the InCharacters parameter is longer than
the string specified by the OutCharacters parameter, the characters
in the InCharacters parameter are deleted if they have no corresponding
character in the OutCharacters parameter.

open HostName [Port] Establishes a connection to the FTP server
at the host specified by the HostName parameter. If the optional port
number is specified, the ftp command attempts to connect to a server
at that port. If the automatic login feature is set (that is, the
-n flag was not specified on the command line), the ftp command attempts
to log in the user to the FTP server.

You must also have a $HOME/.netrc file with the correct information
in it and the correct permissions set. The .netrc file must be in
your home directory.

prompt Toggles interactive prompting. If interactive prompting is
on (the default), the ftp command prompts for verification before
retrieving, sending, or deleting multiple files during the mget, mput,
and mdelete subcommands. Otherwise, the ftp command acts accordingly
on all files specified.

proxy [Subcommand] Executes an ftp command on a secondary control
connection. This subcommand allows the ftp command to connect simultaneously
to two remote FTP servers for transferring files between the two servers.
The first proxy subcommand should be an open subcommand to establish
the secondary control connection. Enter the proxy ? subcommand to
see the other ftp subcommands that are executable on the secondary
connection.

The following subcommands behave differently when prefaced by the
proxy subcommand:

* The open subcommand does not define new macros during the
automatic login process.

* The close subcommand does not erase existing macro definitions.

* The get and mget subcommands transfer files from the host
on the primary connection to the host on the secondary connection.

* The put, mput, and append subcommands transfer files from
the host on the secondary connection to the host on the primary connection.

* The restart subcommand can be handled by the proxy command.

* The status subcommand displays accurate information.

File transfers require that the FTP server on the secondary connection
must support the PASV (passive) instruction.

put LocalFile [RemoteFile] Stores a local file on the remote host.
If you do not specify the RemoteFile parameter, the ftp command uses
the local file name to name the remote file, and the remote file name
is altered by any settings made by the ntrans and nmap subcommands.
The ftp command uses the current settings for the type, form, mode,
and struct subcommands while transferring the files.

pwd Displays the name of the current directory on the remote host.

quit Closes the connection and exits the ftp command. Same as the
bye subcommand.

quote String Sends the string specified by the String parameter verbatim
to the remote host. Execute the remotehelp or quote help subcommand
to display a list of valid values for the String parameter.

Note: “Quoting” commands that involve data transfers can produce unpredictable
results.

record Synonym for the struct record subcommand.

recv RemoteFile [LocalFile] Copies the remote file to the local
host. Same as the get subcommand.

reinitialize Reinitializes an FTP session by flushing all I/O and
allowing transfers to complete. Resets all defaults as if a user had
just started an FTP session without logging in to a remote host.

remotehelp [Subcommand] Requests help from the remote FTP server.

rename FromName ToName Renames a file on the remote host.

reset Clears the reply queue. This subcommand resynchronizes the command
parsing.

restart get | put | append Restarts a file transfer at the point
where the last checkpoint was made. To run successfully, the subcommand
must be the same as the aborted subcommand, including structure, type,
and form. Valid arguments are get, put, and append.

rmdir RemoteDirectory Removes the remote directory specified by the
RemoteDirectory parameter at the remote host.

runique (ReceiveUnique) Toggles the facility for creating unique
file names for local destination files during get and mget subcommands.
If this facility is Off (the default), the ftp command overwrites
local files. Otherwise, if a local file has the same name as that
specified for a local destination file, the ftp command modifies the
specified name of the local destination file with .1. If a local file
is already using the new name, the ftp command appends the postfix
.2 to the specified name. If a local file is already using this second
name, the ftp command continues incrementing the postfix until it
either finds a unique file name or reaches .99 without finding a unique
file name. If the ftp command cannot find a unique file name, the
ftp command reports an error and the transfer does not take place.
Note that the runique subcommand does not affect local file names
generated from a shell command.

send LocalFile [RemoteFile] Stores a local file on the remote host.
Same as the put subcommand.

sendport Toggles the use of FTP PORT instructions. By default, the
ftp command uses a PORT instruction when establishing a connection
for each data transfer. When the use of PORT instructions is disabled,
the ftp command does not use PORT instructions for data transfers.
The PORT instruction is useful when dealing with FTP servers that
ignore PORT instructions while incorrectly indicating the instructions
have been accepted.

site Args Displays or sets the idle time-out period, displays or sets
the file-creation umask, or changes the permissions of a file, using
the chmod command. Possible values for the Args parameter are umask
and chmod.

size RemoteFile Displays the size in bytes of the remote file specified
by the RemoteFile parameter.

status Displays the current status of the ftp command as well as the
status of the subcommands.

stream Synonym for the mode stream subcommand.

struct [ file | record ] Sets the data transfer structure type.
Valid arguments are file and record.

file Sets the data-transfer structure type to file.

record Sets the data-transfer structure type to record.

sunique (Send/Store Unique) Toggles the facility for creating unique
file names for remote destination files during put and mput subcommands.
If this facility is off (the default), the ftp command overwrites
remote files. Otherwise, if a remote file has the same name as that
specified for a remote destination file, the remote FTP server modifies
the name of the remote destination file. Note that the remote server
must support the STOU instruction.

system Shows the type of operating system running on the remote machine.

telnet Synonym for the form telnet subcommand.

tenex Synonym for the type tenex subcommand.

trace Toggles packet tracing.

type [ ascii | binary | ebcdic | image | local M | tenex ] Sets
the file-transfer type. Valid arguments are ascii, binary, ebcdic,
image, local M, and tenex. If an argument is not specified, the current
type is printed. The default type is ascii; the binary type can be
more efficient than ascii.

ascii Sets the file-transfer type to network ASCII. This type is the
default. File transfer may be more efficient with binary-image transfer.
See the binary argument for further information.

binary Sets the file-transfer type to binary image. This type can
be more efficient than an ASCII transfer.

ebcdic Sets the file-transfer type to EBCDIC.

image Sets the file-transfer type to binary image. This type can be
more efficient than an ASCII transfer.

local M Sets the file-transfer type to local. The M parameter defines
the decimal number of bits per machine word. This parameter does not
have a default.

tenex Sets the file-transfer type to that needed for TENEX machines.

user User [Password] [Account] Identifies the local user (User)
to the remote FTP server. If the Password or Account parameter is
not specified and the remote server requires it, the ftp command prompts
for the password or account locally. If the Account parameter is required,
the ftp command sends it to the remote server after the remote login
process completes.

Note: Unless automatic login is disabled by specifying the -n flag
on the command line, the ftp command sends the User, Password, and
Account parameters automatically for the initial connection to the
remote server. You also need a .netrc file in your home directory
in order to issue an automatic login.

verbose Toggles verbose mode. When the verbose mode is on (the default),
the ftp command displays all responses from the remote FTP server.
Additionally, the ftp command displays statistics on all file transfers
when the transfers complete.

Examples

1. To invoke the ftp command, log in to the system canopus, display
local help information, display remote help information, display status,
toggle the bell, prompt, runique, trace, and verbose subcommands,
and then quit, enter:

$ ftp canopus
Connected to canopus.austin.century.com.
220 canopus.austin.century.com FTP server (Version 4.1 Sat Nov 23
12:52:09 CST 1991) ready.
Name (canopus:eric): dee
331 Password required for dee.
Password:
230 User dee logged in.
ftp> help
Commands may be abbreviated. Commands are:
! delete mdelete proxy runique
$ debug mdir sendport send
account dir mget put size
append disconnect mkdir pwd status
ascii form mls quit struct
bell get mode quote sunique
binary glob modtime recv system
bye hash mput remotehelp tenex
case help nmap rstatus trace
cd image nlist rhelp type
cdup lcd ntrans rename user
close ls open reset verbose
cr macdef prompt rmdir ?
ftp> remotehelp
214-The following commands are recognized(* =>’s unimplemented).
USER PORT RETR MSND* ALLO DELE SITE* XMKD CDUP
PASS PASV STOR MSOM* REST* CWD STAT* RMD XCUP
ACCT* TYPE APPE MSAM* RNFR XCWD HELP XRMD STOU
REIN* STRU MLFL* MRSQ* RNTO LIST NOOP PWD
QUIT MODE MAIL* MRCP* ABOR NLST MKD XPWD
214 Direct comments to [email protected]
ftp> status
Connected to canopus.austin.century.com.
No proxy connection.
Mode: stream; Type: ascii; Form: non-print; Structure: file
Verbose: on; Bell: off; Prompting: on; Globbing: on
Store unique: off; Receive unique: off
Case: off; CR stripping: on
Ntrans: off
Nmap: off
Hash mark printing: off; Use of PORT cmds: on
ftp> bell
Bell mode on.
ftp> prompt
Interactive mode off.
ftp> runique
Receive unique on.
ftp> trace
Packet tracing on.
ftp> verbose
Verbose mode off.
ftp> quit
$

2. To invoke the ftp command, log in to the system canopus, print
the working directory, change the working directory, set the file
transfer type to ASCII, send a local file to the remote host, change
the working directory to the parent directory, and then quit, enter:

$ ftp canopus
Connected to canopus.austin.century.com.
220 canopus.austin.century.com FTP server (Version 4.1 Sat Nov 23
12:52:09 CST 1991) ready.
Name (canopus:eric): dee
331 Password required for dee.
Password:
230 User dee logged in.
ftp> pwd
257 “/home/dee” is current directory.
ftp> cd desktop
250 CWD command successful.
ftp> type ascii
200 Type set to A.
ftp> send typescript
200 PORT command successful.
150 Opening data connection for typescript (128.114.4.99,1412).
226 Transfer complete.
ftp> cdup
250 CWD command successful.
ftp> bye
221 Goodbye.
$

3. To invoke the ftp command with automatic logon (using the .netrc
file), open a session with the system canopus, log in, change the
working directory to the parent directory, print the working directory,
list the contents of the current directory, delete a file, write a
listing of the contents of the current directory to a local file,
close the session, and then quit, enter:

$ ftp canopus
Connected to canopus.austin.century.com.
220 canopus.austin.century.com FTP server (Version 4.1 Sat Nov 23
12:52:09 CST 1991) ready.
331 Password required for dee.
230 User dee logged in.
ftp> cdup
250 CWD command successful.
ftp> pwd
257 “/home” is current directory.
ftp> dir
200 PORT command successful.
150 Opening data connection for /usr/bin/ls (128.114.4.99,1407)
(0 bytes).
total 104
drwxr-xr-x 2 system 32 Feb 23 17:55 bin
Drwxr-xr-x 26 rios 4000 May 30 17:18 bin1
drwxr-xr-x 2 system 32 Feb 23 17:55 books
drwxrwxrwx 18 rios 1152 Jun 5 13:41 dee
-r–r–r– 1 system 9452 May 17 12:21 filesystems
drwxr-xr-x 2 system 32 Feb 23 17:55 jim
drwxr-xr-x 5 system 80 Feb 23 17:55 krs
drwxrwxrwx 2 rios 16432 Feb 23 17:36 lost+found
-rwxr-xr-x 1 rios 3651 May 24 16:45 oldmail
drwxr-xr-x 2 system 256 Feb 23 17:55 pubserv
drwxrwxrwx 2 system 144 Feb 23 17:55 rein989
drwxr-xr-x 2 system 112 Feb 23 17:55 reinstall
226 Transfer complete.
ftp> delete oldmail
250 DELE command successful.
ftp> mdir /home/dee/bin binlist
output to local-file: binlist? y
200 PORT command successful.
150 Opening data connection for /usr/bin/ls (128.114.4.99,1408) (0
bytes).
226 Transfer complete.
ftp> close
221 Goodbye.
ftp> quit
$

Implementation Specifics

Software Product/Option: Base Operating System/ AIX 3.2 to 4.1 Compatibility
Links

Standards Compliance: OSF/1, OSF Level 3, BSD 4.3

Files

/usr/lpp/tcpip/samples/.netrc Contains the sample .netrc file.

/etc/syslog.conf Contains configuration information for the syslogd
daemon.

Related Information

The csh command, kill command, rcp command, refresh command, stty
command, tftp command.

The syslogd daemon.

The .netrc file format.

Copying Files Using the ftp Command in AIX Version 4.1 System User’s
Guide: Communications and Networks.

Network Overview in AIX Version 4.1 System Management Guide: Communications
and Networks.

=================================================================
=================================================================

ftpd Daemon

Purpose

Provides the server function for the Internet FTP protocol.

Syntax

Note: The ftpd daemon is normally started by the inetd daemon. It
can also be controlled from the command line, using SRC commands.

/usr/sbin/ftpd [ -d ] [ -k ] [ -l ] [ -t TimeOut ] [ -T MaxTimeOut
] [ -s ] [ -u OctalVal ]

Description

The /usr/sbin/ftpd daemon is the DARPA Internet File Transfer Protocol
(FTP) server process. The ftpd daemon uses the Transmission Control
Protocol (TCP) to listen at the port specified with the ftp command
service specification in the /etc/services fil.

Changes to the ftpd daemon can be made using the System Management
Interface Tool (SMIT) or System Resource Controller (SRC), by editing
the /etc/inetd.conf or /etc/services file. Entering ftp at the command
line is not recommended. The ftpd daemon is started by default when
it is uncommented in the /etc/inetd.conf file.

The inetd daemon gets its information from the /etc/inetd.conf file
and the /etc/services file.

If you change the /etc/inetd.conf or /etc/services file, run the refresh
-s inetd or kill -1 InetdPID command to inform the inetd daemon of
the changes to its configuration files.

The ftpd daemon expands file names according to the conventions of
the csh command. This command allows you to use such metacharacters
as the * (asterisk), the ? (question mark), [ ] (left and right
brackets), { } (left and right braces), and the ~ (tilde).

Before the ftpd daemon can transfer files for a client process, it
must authenticate the client process. The ftpd daemon authenticates
client processes according to these rules:

* The user must have a password in the password database, /etc/security/passwd.
(If the user’s password is not null, the client process must provide
that password.)

* The user name must not appear in the /etc/ftpusers file.

* The user’s login shell must appear in the shells attribute
of the /etc/security/login.cfg file.

* If the user name is anonymous or ftp, an anonymous FTP account
must be defined in the password file. In this case, the client process
is allowed to log in using any password. By convention, the password
is the name of the client host. The ftpd daemon takes special measures
to restrict access by the client process to the anonymous account.

File Transfer Protocol Subtree Guidelines

When handling an anonymous FTP user, the server performs the chroot
command in the home directory of the FTP user account. For greater
security, implement the following rules when you construct the FTP
subtree:

~ftp Make the home directory owned by root and mode r-xr-xr-x (555).

~ftp/bin Make this directory owned by the root user and unwritable
by anyone. The ls program must be present in this directory to support
the list command. This program should have mode 111.

~ftp/etc Make this directory owned by the root user and unwritable
by anyone.

~ftp/pub Make this directory mode 777 and owned by FTP. Users should
then place files that are to be accessible through the anonymous account
in this directory.

Note: The shell script /usr/samples/tcpip/anon.ftp uses the above
rules to set up the anonymous FTP account for you.

The server must run as the root user to create sockets with privileged
port numbers. The server maintains an effective user ID of the logged-in
user, reverting to the root user only when binding addresses to sockets.

Supported File Transfer Protocol Requests

The ftpd daemon currently supports the following FTP requests:

ABOR Terminates previous command.

ACCT Specifies account (ignored).

ALLO Allocates storage (vacuously).

APPE Appends to a file.

CDUP Changes to the parent directory of the current working directory.

CWD Changes working directory.

DELE Deletes a file.

HELP Gives help information.

LIST Gives list files in a directory (this FTP request is the same
as the ls -lA command).

MKD Makes a directory.

MDTM Shows last modification time of file.

MODE Specifies data transfer mode.

NLST Gives a name list of files in directory (this FTP request is
the same as the ls command).

NOOP Does nothing.

PASS Specifies a password.

PASV Prepares for server-to-server transfers.

PORT Specifies a data connection port.

PWD Prints the current working directory.

QUIT Terminates session.

RETR Retrieves a file.

RMD Removes a directory.

RNFR Specifies rename-from file name.

RNTO Specifies rename-to file name.

SITE The following nonstandard or UNIX-specific commands are supported
by the SITE request:

UMASK Changes umask (SITE UMASK 002).

IDLE Sets idler time (SITE IDLE 60).

CHMOD Changes mode of a file (SITE CHMOD 755 FileName).

HELP Gives help information (SITE HELP).

SIZE Returns size of current file.

STAT Returns the status of the server.

STOR Stores a file.

STOU Stores a file using a unique file name.

STRU Specifies the structure of data transfer as a file structure.

SYST Shows operating system type of server system.

TYPE Specifies data transfer type with the Type parameter.

USER Specifies user name.

XCUP Changes the parent directory of the current working directory
(not normally used).

XCWD Changes current directory (not normally used).

XMKD Creates a directory (not normally used).

XPWD Prints the current working directory (not normally used).

XRMD Removes a directory (not normally used).

The remaining FTP requests defined in Internet RFC 959 are recognized,
but not implemented. The MDTM and SIZE requests are not specified
by RFC 959, but are scheduled to appear in the next updated FTP RFC.

If a STAT request is received during a data transfer and preceded
by both a Telnet IP signal and SYNCH signal, transfer status is returned.

The ftpd daemon should be controlled using the System Management Interface
Tool (SMIT) or by changing the /etc/inetd.conf file. Entering ftpd
at the command line is not recommended.

Manipulating the ftpd Daemon with the System Resource Controller

The ftpd daemon is a subserver of the inetd daemon, which is a subsystem
of the System Resource Controller (SRC). The ftpd daemon is a member
of the tcpip SRC subsystem group. This daemon is enabled by default
in the /etc/inetd.conf file and can be manipulated by the following
SRC commands:

startsrc Starts a subsystem, group of subsystems, or a subserver.

stopsrc Stops a subsystem, group of subsystems, or a subserver.

lssrc Gets the status of a subsystem, group of subsystems, or a subserver.

Flags

-d Sends debugging information about ftpd daemon operations to the
syslogd daemon. If you specify the -d flag, you must edit the /etc/syslog.conf
file and add the following entry:

daemon.debug FileName

Note: The syslogd daemon’s debug level includes info level messages.

If you do not edit the /etc/syslog.conf file, no messages are produced.
After changing the /etc/syslog.conf file, run the refresh -s syslogd
command or kill -1 SyslogdPID command to inform the syslogd daemon
of the changes to its configuration file. For more information about
debug levels, refer to the /etc/syslog.conf file.

-k Sets the SO_KEEPALIVE option defined in the sys/socket.h file on
the data transfer socket to enable the data transfer to time out in
the event TCP/IP hangs. The idle interval time is based on systemwide
values designated by the tcp_keepidle and tcp_keepintvl options of
the no command. Without the flag, ftpd data transfer will not time
out.

-l Sends logging information about ftpd daemon operations to the syslogd
daemon. If you specify the -l flag, you must edit the /etc/syslog.conf
file and add the following entry:

daemon.info FileName

If you do not edit the /etc/syslog.conf file, no messages are produced.
After changing the /etc/syslog.conf file, run the refresh -s syslogd
command or kill -1 SyslogdPID command to inform the syslogd daemon
of the changes to its configuration file. For more information about
debug levels, refer to the /etc/syslog.conf file.

-t TimeOut Logs out inactive sessions after the number of seconds
specified by the TimeOut variable. The default limit is 15 minutes
(900 seconds).

-T MaxTimeOut Logs out inactive client sessions after a maximum number
of seconds specified by the MaxTimeOut variable. The default limit
is 2 hours (7200 seconds).

-s Turns on socket-level debugging.

-u OctalVal Sets the ftpd daemon’s umask. The OctalVal variable must
be specified as an octal value to define the umask. The default umask
is an octal value of 027, which results in file permissions of rw-r—–.

Examples

Note: The arguments for the ftpd daemon can be specified by using
SMIT or by editing the /etc/inetd.conf file.

1. To start the ftpd daemon, enter the following:

startsrc -t ftp

The startsrc command with the -t flag starts the ftpd subserver. You
must use the -t flag to specify a subserver. Otherwise, the command
does not execute properly.

2. To stop the ftpd daemon normally, enter the following:

stopsrc -t ftp

The stopsrc command with the -t flag stops the ftpd subserver. The
stopsrc command allows all pending connections to start and all existing
connections to complete, but prevents new connections from starting.
You must use the -t flag to specify a subserver. Otherwise, the command
does not execute properly.

3. To force the ftpd daemon and all ftpd connections to stop, enter
the following:

stopsrc -t -f ftp

The stopsrc command with the -t and -f flags forces the ftpd subserver
to stop. It terminates all pending connections and existing connections
immediately.

4. To display a short status report about the ftpd daemon, enter the
following:

lssrc -t ftp

Th lssrc command with the -t flag returns the daemon’s name, process
ID, and state (active or inactive). You must use the -t flag to specify
a subserver. Otherwise, the command does not execute properly.

Implementation Specifics

This daemon is part of TCP/IP in Network Support Facilities in Base
Operating System (BOS) Runtime.

Files

/etc/locks/ftpd Contains interlock and process ID (PID) storage.

/etc/group Contains passwords for groups.

/etc/passwd Contains passwords for users.

/etc/security/login.cfg Contains configuration information for login
and user authentication.

/etc/security/passwd Contains encrypted passwords.

/etc/syslog.conf Contains configuration information for the syslogd
daemon.

/usr/samples/tcpip/anon.ftp Contains the example shell script with
which to set up an anonymous FTP account. This file also contains
directions for its use.

Related Information

The ftp command, lssrc command, kill command, no command, refresh
command, startsrc command, stopsrc command.

The inetd daemon, syslogd daemon.

The /etc/ftpusers file format, /etc/inetd.conf file format, /etc/services
file format.

TCP/IP Daemons in AIX Version 4.1 System Management Guide: Communications
and Networks.

=================================================================
=================================================================

ftpd Daemon

Purpose

Provides the server function for the Internet FTP protocol.

Syntax

Note: The ftpd daemon is normally started by the inetd daemon. It
can also be controlled from the command line, using SRC commands.

/usr/sbin/ftpd [ -d ] [ -k ] [ -l ] [ -t TimeOut ] [ -T MaxTimeOut
] [ -s ] [ -u OctalVal ]

Description

The /usr/sbin/ftpd daemon is the DARPA Internet File Transfer Protocol
(FTP) server process. The ftpd daemon uses the Transmission Control
Protocol (TCP) to listen at the port specified with the ftp command
service specification in the /etc/services fil.

Changes to the ftpd daemon can be made using the System Management
Interface Tool (SMIT) or System Resource Controller (SRC), by editing
the /etc/inetd.conf or /etc/services file. Entering ftp at the command
line is not recommended. The ftpd daemon is started by default when
it is uncommented in the /etc/inetd.conf file.

The inetd daemon gets its information from the /etc/inetd.conf file
and the /etc/services file.

If you change the /etc/inetd.conf or /etc/services file, run the refresh
-s inetd or kill -1 InetdPID command to inform the inetd daemon of
the changes to its configuration files.

The ftpd daemon expands file names according to the conventions of
the csh command. This command allows you to use such metacharacters
as the * (asterisk), the ? (question mark), [ ] (left and right
brackets), { } (left and right braces), and the ~ (tilde).

Before the ftpd daemon can transfer files for a client process, it
must authenticate the client process. The ftpd daemon authenticates
client processes according to these rules:

* The user must have a password in the password database, /etc/security/passwd.
(If the user’s password is not null, the client process must provide
that password.)

* The user name must not appear in the /etc/ftpusers file.

* The user’s login shell must appear in the shells attribute
of the /etc/security/login.cfg file.

* If the user name is anonymous or ftp, an anonymous FTP account
must be defined in the password file. In this case, the client process
is allowed to log in using any password. By convention, the password
is the name of the client host. The ftpd daemon takes special measures
to restrict access by the client process to the anonymous account.

File Transfer Protocol Subtree Guidelines

When handling an anonymous FTP user, the server performs the chroot
command in the home directory of the FTP user account. For greater
security, implement the following rules when you construct the FTP
subtree:

~ftp Make the home directory owned by root and mode r-xr-xr-x (555).

~ftp/bin Make this directory owned by the root user and unwritable
by anyone. The ls program must be present in this directory to support
the list command. This program should have mode 111.

~ftp/etc Make this directory owned by the root user and unwritable
by anyone.

~ftp/pub Make this directory mode 777 and owned by FTP. Users should
then place files that are to be accessible through the anonymous account
in this directory.

Note: The shell script /usr/samples/tcpip/anon.ftp uses the above
rules to set up the anonymous FTP account for you.

The server must run as the root user to create sockets with privileged
port numbers. The server maintains an effective user ID of the logged-in
user, reverting to the root user only when binding addresses to sockets.

Supported File Transfer Protocol Requests

The ftpd daemon currently supports the following FTP requests:

ABOR Terminates previous command.

ACCT Specifies account (ignored).

ALLO Allocates storage (vacuously).

APPE Appends to a file.

CDUP Changes to the parent directory of the current working directory.

CWD Changes working directory.

DELE Deletes a file.

HELP Gives help information.

LIST Gives list files in a directory (this FTP request is the same
as the ls -lA command).

MKD Makes a directory.

MDTM Shows last modification time of file.

MODE Specifies data transfer mode.

NLST Gives a name list of files in directory (this FTP request is
the same as the ls command).

NOOP Does nothing.

PASS Specifies a password.

PASV Prepares for server-to-server transfers.

PORT Specifies a data connection port.

PWD Prints the current working directory.

QUIT Terminates session.

RETR Retrieves a file.

RMD Removes a directory.

RNFR Specifies rename-from file name.

RNTO Specifies rename-to file name.

SITE The following nonstandard or UNIX-specific commands are supported
by the SITE request:

UMASK Changes umask (SITE UMASK 002).

IDLE Sets idler time (SITE IDLE 60).

CHMOD Changes mode of a file (SITE CHMOD 755 FileName).

HELP Gives help information (SITE HELP).

SIZE Returns size of current file.

STAT Returns the status of the server.

STOR Stores a file.

STOU Stores a file using a unique file name.

STRU Specifies the structure of data transfer as a file structure.

SYST Shows operating system type of server system.

TYPE Specifies data transfer type with the Type parameter.

USER Specifies user name.

XCUP Changes the parent directory of the current working directory
(not normally used).

XCWD Changes current directory (not normally used).

XMKD Creates a directory (not normally used).

XPWD Prints the current working directory (not normally used).

XRMD Removes a directory (not normally used).

The remaining FTP requests defined in Internet RFC 959 are recognized,
but not implemented. The MDTM and SIZE requests are not specified
by RFC 959, but are scheduled to appear in the next updated FTP RFC.

If a STAT request is received during a data transfer and preceded
by both a Telnet IP signal and SYNCH signal, transfer status is returned.

The ftpd daemon should be controlled using the System Management Interface
Tool (SMIT) or by changing the /etc/inetd.conf file. Entering ftpd
at the command line is not recommended.

Manipulating the ftpd Daemon with the System Resource Controller

The ftpd daemon is a subserver of the inetd daemon, which is a subsystem
of the System Resource Controller (SRC). The ftpd daemon is a member
of the tcpip SRC subsystem group. This daemon is enabled by default
in the /etc/inetd.conf file and can be manipulated by the following
SRC commands:

startsrc Starts a subsystem, group of subsystems, or a subserver.

stopsrc Stops a subsystem, group of subsystems, or a subserver.

lssrc Gets the status of a subsystem, group of subsystems, or a subserver.

Flags

-d Sends debugging information about ftpd daemon operations to the
syslogd daemon. If you specify the -d flag, you must edit the /etc/syslog.conf
file and add the following entry:

daemon.debug FileName

Note: The syslogd daemon’s debug level includes info level messages.

If you do not edit the /etc/syslog.conf file, no messages are produced.
After changing the /etc/syslog.conf file, run the refresh -s syslogd
command or kill -1 SyslogdPID command to inform the syslogd daemon
of the changes to its configuration file. For more information about
debug levels, refer to the /etc/syslog.conf file.

-k Sets the SO_KEEPALIVE option defined in the sys/socket.h file on
the data transfer socket to enable the data transfer to time out in
the event TCP/IP hangs. The idle interval time is based on systemwide
values designated by the tcp_keepidle and tcp_keepintvl options of
the no command. Without the flag, ftpd data transfer will not time
out.

-l Sends logging information about ftpd daemon operations to the syslogd
daemon. If you specify the -l flag, you must edit the /etc/syslog.conf
file and add the following entry:

daemon.info FileName

If you do not edit the /etc/syslog.conf file, no messages are produced.
After changing the /etc/syslog.conf file, run the refresh -s syslogd
command or kill -1 SyslogdPID command to inform the syslogd daemon
of the changes to its configuration file. For more information about
debug levels, refer to the /etc/syslog.conf file.

-t TimeOut Logs out inactive sessions after the number of seconds
specified by the TimeOut variable. The default limit is 15 minutes
(900 seconds).

-T MaxTimeOut Logs out inactive client sessions after a maximum number
of seconds specified by the MaxTimeOut variable. The default limit
is 2 hours (7200 seconds).

-s Turns on socket-level debugging.

-u OctalVal Sets the ftpd daemon’s umask. The OctalVal variable must
be specified as an octal value to define the umask. The default umask
is an octal value of 027, which results in file permissions of rw-r—–.

Examples

Note: The arguments for the ftpd daemon can be specified by using
SMIT or by editing the /etc/inetd.conf file.

1. To start the ftpd daemon, enter the following:

startsrc -t ftp

The startsrc command with the -t flag starts the ftpd subserver. You
must use the -t flag to specify a subserver. Otherwise, the command
does not execute properly.

2. To stop the ftpd daemon normally, enter the following:

stopsrc -t ftp

The stopsrc command with the -t flag stops the ftpd subserver. The
stopsrc command allows all pending connections to start and all existing
connections to complete, but prevents new connections from starting.
You must use the -t flag to specify a subserver. Otherwise, the command
does not execute properly.

3. To force the ftpd daemon and all ftpd connections to stop, enter
the following:

stopsrc -t -f ftp

The stopsrc command with the -t and -f flags forces the ftpd subserver
to stop. It terminates all pending connections and existing connections
immediately.

4. To display a short status report about the ftpd daemon, enter the
following:

lssrc -t ftp

Th lssrc command with the -t flag returns the daemon’s name, process
ID, and state (active or inactive). You must use the -t flag to specify
a subserver. Otherwise, the command does not execute properly.

Implementation Specifics

This daemon is part of TCP/IP in Network Support Facilities in Base
Operating System (BOS) Runtime.

Files

/etc/locks/ftpd Contains interlock and process ID (PID) storage.

/etc/group Contains passwords for groups.

/etc/passwd Contains passwords for users.

/etc/security/login.cfg Contains configuration information for login
and user authentication.

/etc/security/passwd Contains encrypted passwords.

/etc/syslog.conf Contains configuration information for the syslogd
daemon.

/usr/samples/tcpip/anon.ftp Contains the example shell script with
which to set up an anonymous FTP account. This file also contains
directions for its use.

Related Information

The ftp command, lssrc command, kill command, no command, refresh
command, startsrc command, stopsrc command.

The inetd daemon, syslogd daemon.

The /etc/ftpusers file format, /etc/inetd.conf file format, /etc/services
file format.

TCP/IP Daemons in AIX Version 4.1 System Management Guide: Communications
and Networks.

Espero que les guste este mini manual de uso de ftp.

Te interesa

The Persistence para PlayStation VR ya disponible en las tiendas españolas

Sony Interactive Entertainment (SIE) anuncia que el videojuego de acción y terror The Persistence, exclusivo de …

Últimas noticias de Frikipandi.com

Las noticias se actualizan cada 15 minutos.