How does sftp work in unix




















Specifies the protocol versions ssh should support in order of preference. The possible values are ' 1 ' and ' 2 '. Multiple versions must be comma-separated. When this option is set to " 2,1 " ssh will try version 2 and fall back to version 1 if version 2 is not available.

The default is ' 2 '. Specifies the command to use to connect to the server. The command string extends to the end of the line, and is executed with the user's shell.

The command can be basically anything, and should read from its standard input and write to its standard output. It should eventually connect an sshd server running on some machine, or execute sshd -i somewhere. Host key management will be done using the HostName of the host being connected defaulting to the name typed by the user.

Setting the command to " none " disables this option entirely. Note that CheckHostIP is not available for connects with a proxy command. This directive is useful in conjunction with nc and its proxy support. For example, the following directive would connect via an HTTP proxy at Specifies whether to try public key authentication. This option applies to protocol version 2 only.

Specifies the maximum amount of data that is transmitted before the session key is renegotiated. The argument is the number of bytes, with an optional suffix of ' K ', ' M ', or ' G ' to indicate Kilobytes, Megabytes, or Gigabytes, respectively.

The default is between ' 1G ' and ' 4G ', depending on the cipher. Specifies whether to try rhosts based authentication with RSA host authentication. This option applies to protocol version 1 only and requires ssh to be setuid root. Specifies whether to try RSA authentication. RSA authentication only attempts if the identity file exists, or an authentication agent is running. Specifies what variables from the local environment should be sent to the server.

Note that environment passing is only supported for protocol 2. The server must also support it, and the server must be configured to accept these environment variables.

Variables are specified by name, which may contain wildcard characters. Multiple environment variables may be separated by whitespace or spread across multiple SendEnv directives. The default is not to send any environment variables. Sets a timeout interval in seconds after which if no data is received from the server, ssh sends a message through the encrypted channel to request a response from the server.

The default is 0 , indicating that these messages are not sent to the server, or if the BatchMode option is set. Sets the number of server alive messages see below which may be sent without ssh receiving any messages back from the server.

If this threshold is reached while server alive messages are sent, ssh will disconnect from the server, terminating the session. The server alive messages are sent through the encrypted channel and therefore are not spoofable. The server alive mechanism is valuable when the client or server depend on knowing when a connection has become inactive. The default value is 3. If, for example, ServerAliveInterval see below is set to 15 and ServerAliveCountMax is left at the default, if the server becomes unresponsive, ssh will disconnect after approximately 45 seconds.

This option applies to protocol version 2 only; in protocol version 1 there is no mechanism to request a response from the server to the server alive messages, so disconnection is the responsibility of the TCP stack. This option forces the user to manually add all new hosts. If this flag is set to " no ", ssh automatically adds new host keys to the user known hosts files. If this flag is set to " ask ", new host keys are added to the user known host files only after the user has confirmed that is what they really want to do, and ssh will refuse to connect to hosts whose host key has changed.

The host keys of known hosts will be verified automatically in all cases. The argument must be " yes ", " no ", or " ask ". The default is " ask ". Specifies whether the system should send TCP keepalive messages to the other side. If they are sent, death of the connection or crash of one of the machines will be properly noticed.

This option only uses TCP keepalives as opposed to using ssh -level keepalives , so takes a long time to notice when the connection dies. As such, you probably want the ServerAliveInterval option as well. However, this means that connections will die if the route is down temporarily, and some people find it annoying.

The default is " yes " to send TCP keepalive messages , and the client notices if the network goes down or the remote host dies. This is important in scripts, and many users want it too. To disable TCP keepalive messages, the value should be set to " no ".

Specifies whether to use a privileged port for outgoing connections. If set to " yes ", ssh must be setuid root. Specifies the user to use for log in.

This can be useful when a different username is used on different machines. This saves the trouble of having to remember to give the username on the command line. Specifies one or more files to use for the user host key database, separated by whitespace. If this option is set to " yes ", the client will implicitly trust keys that match a secure fingerprint from DNS. Insecure fingerprints will be handled as if this option was set to " ask ". If this option is set to " ask ", information on fingerprint match will be displayed, but the user will still need to confirm new host keys according to the StrictHostKeyChecking option.

Specify how many requests may be outstanding at any one time. Increasing this may slightly improve file transfer speed but increases memory usage. The default is 64 outstanding requests. Recursively copy entire directories when uploading and downloading. Note that sftp does not follow symbolic links encountered in the tree traversal.

Name of the program to use for the encrypted connection. The program must understand ssh options. Specifies the SSH2 subsystem or the path for an sftp server on the remote host. A path is useful for using sftp over protocol version 1, or when the remote sshd does not have an sftp subsystem configured. Change group of file path to grp. Change the permissions of file path to mode.

Change owner of file path to own. Display usage information for the filesystem holding the current directory or path if specified. If the -h flag is specified, the capacity information will be displayed using "human-readable" suffixes.

The -i flag requests display of inode information in addition to capacity information. This command is only supported on servers that implement the " [email protected] " extension.

We can download remote files with a different name by specifying the name at the end. This applies only while downloading the single file. We hope this tuts will help you to understand the usage of SFTP to some extent.

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! If you like what you are reading, please consider buying us a coffee or 2 as a token of appreciation.

We are thankful for your never ending support. Specifying the Source and Target for Copy Operations. The sftp command is an interactive file transfer program with a user interface similar to ftp. Not all options available with the ftp command are included in the sftp command, but many of them are.

For more information, see the sftp 1 man page. You can now use any of the commands that are supplied by the sftp interface, including help. The principal commands are summarized in Table This sftp session was established to connect to the remote system pluto :. The directory from which you type the sftp command is the local working directory and thus the source directory for this operation. Search Scope:. To start an SFTP session, at the shell prompt, enter:. For example, if your username is darvader , to connect to your account on the host deathstar.

This is document akqg in the Knowledge Base. Last modified on Skip to: content search login.



0コメント

  • 1000 / 1000