sftp
is an ansible role which:
- adds sftp users
- configures user access to chroot environment
- adds writable user folders
- mounts system paths
Note: see this blog post for more details.
Using ansible-galaxy
:
$ ansible-galaxy install franklinkim.sftp
Using arm
(Ansible Role Manager):
$ arm install franklinkim.sftp
Using git
:
$ git clone https://github.com/weareinteractive/ansible-sftp.git
Here is a list of all the default variables for this role, which are also available in defaults/main.yml
.
# sftp_users:
# - username: foobar
# name: Foo Bar
# # openssl passwd -salt 'somesalt' -1 'secret'
# password: '$1$somesalt$jezmI5TSY7mVTzHLgsK5L.'
# authorized_keys: []
# home: /home
# group: ftp
# groups:
# - staff
# - www-data
# mount_points:
# - { name: foo, path: /path/to/foo }
#
# list of sftp users
sftp_users: []
# default user group
sftp_users_group:
# default user groups
sftp_users_groups: []
# users home directory
sftp_users_home: /home
# list of user writeable folders
sftp_users_folders: ['files']
These are the handlers that are defined in handlers/main.yml
.
restart sftp
- hosts: all
sudo: yes
roles:
- franklinkim.sftp
vars:
sftp_users_group: ftp
sftp_users:
- username: foobar
name: Foo Bar
password: '$1$somesalt$jezmI5TSY7mVTzHLgsK5L.'
mount_points:
- name: tmp
path: /tmp
$ git clone https://github.com/weareinteractive/ansible-sftp.git
$ cd ansible-sftp
$ vagrant up
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests and examples for any new or changed functionality.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Copyright (c) We Are Interactive under the MIT license.