How to use the sftp command in Linux?

The sftp command is a tool used in the Linux system for secure file transfer through SSH protocol. It offers an interactive interface similar to FTP, allowing for file transfer between local and remote servers.

The typical syntax for using the sftp command is as follows:

sftp [选项] [用户名@]主机

Could you please rephrase the following sentence in English?

  1. -b: Read batch processing commands from a specified file and execute them.
  2. – B: Specify the effective bandwidth limit for sftp.
  3. Specify an alternative ssh configuration file.
  4. -i: Specify the private key file for authentication.
  5. -P: specify the port number on the remote server.
  6. -s: Execute the specified command.

Once connected to the remote server, you can utilize the following commands for file transfer:

  1. download files from a remote server.
  2. Upload files to a remote server.
  3. ls: List files and directories on the remote server.
  4. Change the current directory on the remote server.
  5. Create a directory on a remote server.
  6. Delete files from a remote server.
  7. pwd: Display the current working directory on the remote server.

Other commonly used commands include ls, rename, chdir, chmod, chown, and so forth.

To end the sftp session, you can type either quit or exit.

Please note that the sftp command is only applicable for connecting to remote servers through the SSH protocol. If you want to use the FTP protocol for file transfer, consider using the ftp command instead.

bannerAds