How to create SFTP user?

Hello,

i tried this tutorial… https://easyengine.io/tutorials/linux/setup-sftp/ for me it’s not working.

Any suggestions? I really don’t want to switch back to ServerPilot because I like easyengine but I noticed that EE articles are bit outdated. I tried to configure EE + SFTP using Ubuntu 16.04.

Well, I have installed easy engine more than 10 virtual machines and I have been followed same steps mentioned in that article and it works perfectly fine without any issue.

Please understand the steps and then try to execute on your machine.

If you want a user that can only access and modify WordPress directories and files (starting from /htdocs) within one or more sites (you can control which sites the user can access), you can also try this method using Bindfs: http://community.easyengine.io/t/setting-up-chroot-sftp-users-for-easyengine-sites-bindfs/8386

For example, here’s an SFTP user I created that can only access two out of several EasyEngine sites installed on the server: https://gyazo.com/9628e6a6c6b9bb9eb9c190fc5ea88f31

Take a backup/snapshot of your server before starting. After you’ve read the thread to understand how it works, setup takes a matter of seconds for each new SFTP user you want to add.

While it says only tested on Ubuntu 14.04, I’ve since tested it on 16.04 and it works perfectly.

But if you want a user that can navigate around the entire server, then the method above is not for you, and a sudo user added to the www-data group would perhaps be a better option.

1 Like

Thanks guys. I tried again - it worked.

I’ve never been able to get the instructions at: https://easyengine.io/tutorials/linux/setup-sftp/ to work, fully.

I follow the instructions to the point of Test SFTP Setup and then always get the following error:

Permission denied (publickey).

This has always been odd to me, because it never asked for the password I already set up. However, I am just now looking into this. Incidentally, I can’t get SFTP or SCP to work fully, either. I can connect, but when I want to transfer files, one way or another, I get a permissions error.

When I administer an EE server, I log in remotely, via SSH from my Mac OS X Terminal App, using a specific username and passphrase. I’m able to log in with said username and do most of what I need, unless it involves file transfer.

When I want to transfer files from the EE server, via SCP from my Mac OS X Terminal App, I can issue the following command:

scp -i ~/.ssh/my-ssh-key USERNAME@IP-ADDRESS:/var/www/DOMAIN.TLD/htdocs/wp-content/themes/THEME-NAME/images/IMAGE.jpg ~/Downloads/scp/

I am asked for my passphrase and, upon successful entry of the passphrase, the command successfully downloads IMAGE.jpg to my Mac OS X Downloads/scp directory - No Problem!

The problems begin when I need to push something back to my EE server; via SCP from my Mac OS X Terminal App. To do this I use something similar to:

scp -i ~/.ssh/my-ssh-key ~/Downloads/scp/welcome.jpg USERNAME@IP-ADDRESS:/var/www/DOMAIN.TLD/htdocs/wp-content/themes/THEME-NAME/images

I always get the following error:

Permission denied

Is there an easy way to fix any/all of these issues?

I thought I should add that when I run the following command:

scp -i ~/.ssh/my-ssh-key ~/Downloads/scp/welcome.jpg USERNAME@IP-ADDRESS:~/

…the file transfers just fine. Only problem then is that I have to move files to the correct location and then change the user/group ownership.