Using SFTP
Last updated: October 24th 2024
Using SFTP on Webdock Stacks
SFTP is actually built in to the SSH daemon which is installed on Ubuntu, so using SFTP is simply a matter of adding a shell user with the correct group assignment and then connecting. You may need to watch out for permission issues however. Here are the steps on how to use SFTP on a typical Webdock stack in order to work in the web root:
Creating Shell User
Create a Shell user in Webdock where you set the user group to "www-data"
At this point you will be able to read files, but probably not write any files and you will experience permission issues
In order to solve the write permission issue, you need to issue the following command on your server. SSH (or use WebSSH) into your server and run:
# sudo chmod -R g+rw /var/www/html
This command basically says "Recursively give Read and Write access to anyone in the group which owns the file or directory, starting in /var/www/html"
This all assumes you have not modified your web root in any way, or changed ownership of your web root. If you have, modify the commands and group above accordingly.
Configuring Authentication
Either enable Password-based authentication or configure your FTP client to use your Key File
To enable password authentication:
In the shell users screen, check the second box and apply the settings.
To use your private key:
In your FTP client, you need to input your private. In this case, we were using Filezilla so this is where you should add your private key, and you should use this key.
Now you should be able to connect to your server with your FTP client.
Note: The host field should should include "sftp://" at the beginning as you see in the screenshot. And the port field should be 22 (or any other port that SSH on your server listens on)
That's it!
Contact Webdock Support if you need assistance.
Related articles
-
Enabling or disabling components
Learn how to Enable or Disable certain components.
Last updated: May 3rd 2023
-
Changing the Web Root
Learn how to change your Web Root...
Last updated: November 8th 2022
-
Securing your Redis installation
Learn how to further secure Redis on Webdock stacks by setting a password and renaming or disabling dangerous commands.
Last updated: November 8th 2022