Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Are there any important differences between this and setting up the same thing on Ubuntu 14.04?
You can setup a GROUP for SFTP USERS. Example for new user “julio”:
$ sudo -i $# addgroup --system sftpusers $# useradd -c “User SFTP for domain.com” -d “/var/www/vhosts/domain.com” -G sftpusers -s /bin/false julio $# passwd julio $# mkdir /var/www/vhosts/domain.com/html $# chown root:root /var/www/vhosts/domain.com/ $# chmod 755 /var/www/vhosts/domain.com/ $# chown julio:sftpusers /var/www/vhosts/domain.com/html
On /etc/ssh/sshd_config, add:
Match Group filetransfer ChrootDirectory %h X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp
$# systemctl restart sshd
This is a good solution for hosting sites for many domains! Julio Covolato <julio.covolato at gmail.com>
How would a non-sudo user get SFTP access to /var/www/html directory?
Can now only view .cache, .nano, .ssh directories.
This comment has been deleted
Hello guys,
I create the user and it accesses SFTP normally, but with all access to the shell.
Then I do the whole process quoted above and as soon as I restrict the user to the specific folder, I can no longer log in with the user.
https://screenshot.net/pt/25l7wf1
I’m trying to create a sftp user to access only the /var/www/my-site.com/wp-content folder, but I can not do it anyways.
Please, can you help me?
I’ve tried to create a group, but as soon as I put the user in the group, I can not log in with this user anymore. So I believe the problem is in the folder path. The user created is in the /home/newuser folder, but within the /newuser folder there is no shortcut folder for /my-site.com. So maybe that’s the problem. Am I right?
Thanks,
Hi - not sure if anyone knows but I’ve set this up correctly and now failing to get access to work from WordPress Dashboard for updates. I’ve added the username & password credentials to my wpconfig file following this other tutorial: https://www.digitalocean.com/community/tutorials/how-to-configure-secure-updates-and-installations-in-wordpress-on-ubuntu
Note: I’m not using a SSH Key as yet so omitted this part.
From FileZilla:
fzSftp started, protocol_version=8
...
Error: Network error: Software caused connection abort
Error: Could not connect to server
From SSH command-line
Connection reset by 138.197.96.36 port 22
Hello, Great article and it helped me resolve my problem. However, I have one more little problem that I cannot seem to figure out and it is to do with WinSCP and chroot.
My issue is that when I use WinSCP to connect to the server I have set up it will work correctly except that the user and owner do not show up correctly. It shows as the UID and GID rather than the actual owner and group It will show the User as a value of 0 and Group as 1005. Its pulling the values from the /etc/group file.
When I access it via the shell it shows correct permissions for user/group -rwxrwsr-x+ 1 root nycdata 132 Mar 5 13:58 testfile.txt
So what I did to try correct this is that I copied the /etc/group and /etc/passwd files to the chrooted folder. Within the chrooted folder I created a folder called /etc. Also I created a folder called /bin and I dropped this into /etc of the chrooted folder.
However I still cannot see the correct permissions when I use WinSCP. Though I have not tried FileZilla. The issue is that I will be having users connecting via WinScp or Filezilla and I would like them to be able to see their files easily.
Not sure where I am going wrong but any advise would be great.
Thank you so much, Patrick