Roots Discourse

Create a new user that have access to a specific folder

Hi all,

I am trying to create a new user and give permission to access a restricted folder. I found many tutorials, suggesting to change the /etc/ssh/sshd_config file, but it’s not working as it should. Do you have any suggestions or maybe there is a way do to that using trellis structure?

In other words:
I want to create a new user: upload-user

This user, when using SFTP, should be able to have access to the following folder:
/srv/www/mysite.com/current/

Not sure if it’s possible but any help would be much appreciated.

You can use the ansible user module for that.
https://docs.ansible.com/ansible/latest/modules/user_module.html
And hook into one of these hooks: