Upsun supports sftp, but the following limitations apply:
- You can only create
sftpaccounts with an existing Upsun user and an SSH key. Custom users and passwords aren’t supported. -
sftpaccess cannot be limited to a specific directory. Instead, access is given to the whole application directory and its mounts.
Open an sftp connection
Run the following command:
sftp "$(upsun ssh --pipe)"When prompted, select the project and environment you want to connect to. The sftp connection is open once the sftp> prompt is displayed in your terminal.
Download a file
Say you want to download a diagram.png file from the web/uploads directory (relative to the app root). To do so, run the following command:
sftp> get web/uploads/diagram.png
The diagram.png file is copied to the current local directory.
Upload a file
Say you want to upload a diagram.png file to the web/uploads directory (relative to the app root). To do so, run the following command:
sftp> put diagram.png web/uploadsUsing a visual SFTP Client (FileZilla, Cyberduck, etc.)
If you want to use a GUI application like FileZilla to drag and drop files, you will need to connect via SFTP using your Upsun SSH keys.
Ensure your public SSH key is added to your Upsun account.
-
Run the following command to get your environment's SSH URL:
upsun ssh --pipeThis will output a string that looks like:
u2dapcb6prp3e-main-7rqtwti@ssh.us-3.platformsh.site -
Configure your SFTP client:
Protocol: SFTP
Host:
ssh.us-3.platformsh.site(The part after the@symbol)Username:
u2dapcb6prp3e-main-7rqtwti(The part before the@symbol)Password: (Leave blank, authentication is handled by your SSH key)
Once connected, you will only be able to upload files into the specific directories you have defined as mounts in your .upsun/config.yaml.
Comments
Please sign in to leave a comment.