How to transfer a file in Terminal Proxy sessions using SFTP
  • 2 minutes to read
  • Dark
    Light
  • PDF

How to transfer a file in Terminal Proxy sessions using SFTP

  • Dark
    Light
  • PDF

Article summary

In this document, you’ll find a step-by-step guide on how to perform file transfer using SFTP in remote Terminal Proxy sessions.

Attention

Some SSH tools, such as MobeXterm, automatically set an SFTP connection to transfer files after logging in with SSH. These SFTP connections won’t work, as the senhasegura proxy treats them separately.

Requirements

  • Terminal Proxy type credential active.
  • Start a connection via Multihop Terminal Proxy.
Info

To transfer files directly to a destination server using SFTP, you must use the Multihop connection because binaries traveling under SFTP have no way to interact with the intermediate terminal.


Transfer via SFTP on the terminal

Due to limitations of the protocol the user can’t use a personal credential to perform the file transfer. Only with a credential registered in senhasegura will be possible to perform the transfer.

Also, it won’t be possible to record the session, but it’s still possible to enable logging with a report of transferred files. To learn how to enable this log, access the File transfer document.

To start, follow the steps and replace the strings with the values ​​described in the table below.

StringDescription
senhasegura_userUser of the senhasegura vault.
senhasegura_vaultHostname or IP address of the senhasegura vault.
credentialCredential user you want to use for access.
target_deviceHostname or IP address of the device you want to access.
mfa_tokenCode generated by MFA Token.
file_nameName of the file to be transferred.
  1. Open the command prompt application of your preference.
    1. Type sftp senhasegura_user[credential@target_device]@senhasegura_vault
      Attention

      If the use of the OTP token is registered, it must be entered as the example: sftp senhasegura_user[credential@target_device]token@senhasegura_vault.

  2. Use the commands below to:
    1. Perform the file upload, type:
      1. put [file_name]
      2. Press the Enter key to start.
      3. When the file is complete, a <file_name> 100% message will be displayed.
    2. Perform the file download, type:
      1. get [file_name]
      2. Press the Enter key to start.
      3. When the file is complete, a <file_name> 100% message will be displayed.
  3. When finished, type:
    1. exit

After completion, the files will be saved. When performing an upload it’ll be saved on the target machine and when downloading it’ll be saved on the user's machine. For the files to be saved within the senhasegura shell, it’s necessary to perform the sftp without the use of Multihop.

Via WinSCP application

  1. Open the WinSCP application on your machine.
  2. On the Login screen fill in the fields in Session section.
    1. File protocol: select SFTP.
    2. Host name: type the hostname or IP address of the senhasegura vault.
    3. Port number: type 22.
    4. User name: type sftp senhasegura_user[credential@target_device]@senhasegura_vault
    5. Password: enter your senhasegura access password
  3. Click Login.

After these steps, the connection will be ready for use, follow the tool's instructions to transfer the files.

Info

If the user has an OTP token configured, use the token in the connection string. sftp senhasegura_user[credential@target_device]mfa_token@senhasegura_vault.

The senhasegura Terminal Proxy also offers another type of file transfer via SCP, to find out how to perform this, access the How to transfer a file in Terminal Proxy sessions using SCP document.


Do you still have questions? Reach out to the senhasegura Community.


Was this article helpful?